问题
After checking phpinfo() I saw that mysqlnd driver installed on linux (php 5.4) has only one API extension (pdo_mysql), but I also want to be able to work with mysqli.
How do I associate mysqlnd driver with mysqli extension?
I guess I can fix this by reinstalling mysql, but is there any workaround?
Please help! Thank you!
回答1:
Assuming that you did install mysql correctly.
Locate your php.ini by executing phpinfo() or by typing the following command:
php --ini
look for something like "Loaded Configuration File:" and copy the full path of your loaded php configuration file (in my case it is located at: /usr/local/etc/php/5.6/php.ini).
Open php.ini in an editor, for an example:
sudo nano /usr/local/etc/php/5.6/php.ini
Now please add (or make sure it's there) the following line in your php.ini:
extension=mysqli.so
(The extension include line might already be there but commented out - uncomment it in that case)
Save your changes, and then restart apache and mysql:
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/mysql restart
After that all should work fine.
If you are interested in installing mysql (in case it was not installed correctly for an example), please run the following command in your terminal screen:
sudo apt-get install php5-mysql
Good luck!
来源:https://stackoverflow.com/questions/34300384/mysqlnd-driver-has-only-one-api-extension-pdo-mysql