PHP 7 MySQL functions

Материал из Webko Wiki
Перейти к навигации Перейти к поиску

Simply compile the mysql function as a php pecl extension and add one line to your php.ini

First get the mysql extension source which was removed in March:


git clone     mysql   --recursive


svn co mysql 


(same code, same timestamp, now static and likely will never be updated again) Then compile the code on your server:

make install

The “make install” should announce where it is copying – copy that path. It will likely be /usr/local/lib/php/extensions/no-debug-non-zts-20141001/ for PHP 7 but it could vary depending on your server setup.

Then edit your php.ini Somewhere either in the “Extensions” section or “MySQL” section, simply add this line:

extension = /usr/local/lib/php/extensions/no-debug-non-zts-20141001/

(change path if needed)

Restart PHP and mysql_* functions should now be working again. Check your php error log if you have any problems (should check it periodically anyway). You will also see the MySQL section back in your phpinfo page.