Enable mysqli in my in

As is discussed here: mysqli works when run directly but not when via js-ajax

I may need to enable mysqli in my webserver php copy. It is enabled in the command line already.

How do I figure out if mysqli is enabled in a specific php copy, and if it's not, how do I install it?

My webserver is running Ubuntu 14.04.2 LTS.

I have now tried having the following extensions in my php.ini file:

extension=mysqli.so
extension=pdo_mysql.so
extension=php_mysqli.so

I have tried running them all separately, restarted mysql and apache, ran sudo php5enmod mysqli and then I run the page again, but the same error keeps popping up in /var/log/apache/error.log:

PHP Fatal error:  Class 'mysqli' not found in /var/www/html/..

And nothing gets added to the sql table unless I run the insert.php from the server side.

When I have all three extension in the php.ini file I get the following errors are well:

Failed loading /usr/lib64/php/modules/ioncube_loader_lin.so:  /usr/lib64/php/modules/ioncube_loader_lin.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib64/php/modules/ixed.lin:  /usr/lib64/php/modules/ixed.lin: cannot open shared object file: No such file or directory
Failed loading /usr/lib64/php/modules/ZendOptimizer.so:  /usr/lib64/php/modules/ZendOptimizer.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib64/php/modules/opcache.so:  /usr/lib64/php/modules/opcache.so: cannot open shared object file: No such file or directory

From your comments it appears your extension_dir was set to /usr/lib64/php/modules but this folder did not exist on your system.

On your system the mysqli.so module was actually found in /usr/lib/php5/20121212/mysqli.so

To resolve the issue, you can set the extension_dir to /usr/lib/php5/20121212 so that the extension=mysqli.so line is able to find the shared object.


You need to recompile your PHP and add the code --enable-all to the end. (I think that command is right. If not the concept is) Your shared objects are not installed.


你需要从Apache服务器打开mysqli服务,然后重新启动Apache服务器

链接地址: http://www.djcxy.com/p/27596.html

上一篇: JavaScript是否承诺在未被拒绝或解决时创建内存泄漏?

下一篇: 在我的中启用mysqli