Page 1 of 1

PHP7 error

Posted: Thu Sep 08, 2016 5:33 pm
by rotezecke
i have a 2.1.5 CMSMS install that started as a in 1.9.x (i think). It was moved to V2 last month with phar installer. some minor issues but all in all, things work fine.

tonight i switched from php5.6.x to 7.x to get an idea what I need to fix - the CMSMS wraps around an old oscommerce install. i expected that part to fail, but got this surprise
PHP Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/xxx/public_html/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc:352
which looks like CMSMS core.

My config file has

Code: Select all

$config['dbms'] = 'mysqli';

inside the lib/adodb_lite/adodbSQL_drivers/ there are 6 subdirectories:
  1. mysql
  1. mysqli
  1. postgres
  1. postgres7
  1. postgres8
  1. postgres64
:) failed attempt to make a numbered list but you get the idea).

I thought most of those are obsolete. I moved the mysql folder out of there, but that makes things worse.
PHP Warning: include_once(/home/xxx/public_html/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc): failed to open stream: No such file or directory in /home/xxx/public_html/lib/adodb_lite/adodb.inc.php on line 52
PHP Warning: include_once(): Failed opening '/home/xxx/public_html/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/xxx/public_html/lib/adodb_lite/adodb.inc.php on line 52
PHP Fatal error: Class 'mysql_driver_ADOConnection' not found in /home/xxx/public_html/lib/adodb_lite/adodb.inc.php on line 82
any idea why mysql is still being used despite the config setting? Thank you.



----------------------------------------------

Cms Version: 2.1.5

Installed Modules:

CGBlog: 1.14
CGExtensions: 1.53.10
CGFeedback: 1.8
CGSimpleSmarty: 2.1.2
CGSmartImage: 1.21.5
CMSContentManager: 1.1.1
CMSMailer: 6.2.14
Captcha: 0.5.3
DesignManager: 1.1.1
FileManager: 1.5.2
FormBuilder: 0.8.1.4
JQueryTools: 1.3.9
ModuleManager: 2.0.4
Navigator: 1.0.3
News: 2.50.5
Search: 1.50.2


Config Information:

php_memory_limit:
max_upload_size: 16000000
url_rewriting: mod_rewrite
page_extension: .html
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Australia/Brisbane
permissive_smarty: false


Php Information:

phpversion: 5.6.25
md5_function: On (True)
json_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_ALL: 32759
E_STRICT: 2048
E_DEPRECATED: 8192
test_file_timedifference: No time difference found
test_db_timedifference: No time difference found
create_dir_and_file: 1
memory_limit: 256M
max_execution_time: 30
register_globals: Off (False)
output_buffering: 4096
disable_functions:
open_basedir:
test_remote_url: Success
file_uploads: On (True)
post_max_size: 16M
upload_max_filesize: 16M
session_save_path: /tmp (0700)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)
check_ini_set: On (True)
curl: On


Performance Information:

allow_browser_cache: Off (False)
browser_cache_expiry: 0
php_opcache: Off (False)
smarty_cache: Off (False)
smarty_compilecheck: Off (False)
smarty_cache_udt: Off (False)
auto_clear_cache_age: On (True)

Server Information:

Server Software: Apache
Server Api: cgi-fcgi
Server Os: Linux 2.6.32-673.8.1.lve1.4.3.el6.x86_64 On x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 10.0.25
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable

----------------------------------------------

Re: PHP7 error

Posted: Thu Sep 08, 2016 5:57 pm
by rotezecke
i found a bunch of custom plugins that use
$db = ADONewConnection('mysql');
I fixed the only one that is called on every page (and the problem persists). but there are many others. will report back once they are all updated.

EDIT: yes, there's more in some UDTs. All good now, thanks.

Re: PHP7 error

Posted: Thu Sep 08, 2016 9:32 pm
by chandra
PHP7 has no support for mysql, You have to use mysqli every time.