vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Errors in server log (https://vborg.vbsupport.ru/showthread.php?t=324626)

RichieBoy67 03-07-2017 07:02 PM

Errors in server log
 
Seeing many of these.. running php 5.6.30


[Thu Mar 02 23:24:31.397570 2017] [proxy_fcgi:error] [pid 4188:tid 139985248311040] [client ###########] AH01071: Got error 'PHP message: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/vhosts/#########.com/httpdocs/global.php(29) : eval()'d code on line 274\nPHP message: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/vhosts/#######.com/httpdocs/global.php(29) : eval()'d code on line 336\n', referer: https://#########.com/showthread.php?t=236793&page=11

i know it is a plug in but I could use help tracking it down..

Thanks:up:

Dave 03-07-2017 07:51 PM

Check for a "global_start" hook.
Looks like the hook you're looking for has a couple hundred lines of code in it.

RichieBoy67 03-07-2017 08:00 PM

1 Attachment(s)
Thanks, That makes sense Dave.

It has to be one of the following plug ins then. Any thoughts?

Dave 03-07-2017 08:12 PM

Hard to tell, open each of them and see which one contains the function "mysql_connect".

RichieBoy67 03-07-2017 08:33 PM

Thanks Dave,

I believe it is Photopost.. Still looking though.

Anything wrong with this?

$dblink = mysql_connect ("$vbhost", "$vbuser", "$vbpass") or die('I cannot connect to the database.');
mysql_select_db ("$dbname2")or die("Could not select forum database");

Dave 03-07-2017 08:35 PM

Yes, that's what makes use of the mysql_* functions which is deprecated in your PHP version.
You can fairly easy change it to make use of the mysqli_* functions though: https://www.phpclasses.org/blog/pack...to-MySQLi.html

RichieBoy67 03-07-2017 08:39 PM

Oh yeah, I see what you mean now...

Like this..

$connection = mysqli_connect( 'host', 'username', 'password'); or die('I cannot connect to the database.');

ok, I got you. Thanks Dave

##The full replacement would be:

$connection = mysqli_connect( 'host', 'username', 'password'); or die('I cannot connect to the database.');

mysqli_select_db( $link, $database) or die("Could not select forum database");
}

Dave 03-07-2017 09:37 PM

You can change it to
PHP Code:

$connection mysqli_connect'host''username''password''database'); 

to make it easier.

I assume that it also makes use of other mysql_* functions, I would double check that.
To port a mysql_query to mysqli_query, you need to specify the connection variable as the first argument and the second argument will be the actual query.

RichieBoy67 03-07-2017 10:26 PM

Thanks!

The only other ones are $vbhost, $vbuser, $vbpass, $dbname and they should not hard to convert. :)

Paul M 03-08-2017 05:13 PM

A product or plugin should never be using native MySQL or MySQLi functions to connect to the database (or for subsequent commands), it should be using the vbulletin database object.


All times are GMT. The time now is 01:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01303 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete