Include mysqli in my copy of php web server

As discussed here: mysqli works on startup directly, but not through js-ajax

I may need to enable mysqli in my php copy of the web server. It is included on the command line already.

How can I find out if mysqli is included in a specific php copy, and if it is not, how to install it?

Ubuntu 14.04.2 LTS is running on my web server.

Now I tried to have the following extensions in the php.ini file:

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

I tried to start them all separately, restarted mysql and apache, ran sudo php5enmod mysqli , and then started the page again, but the same error continues to appear in /var/log/apache/error.log:

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

And nothing is added to the sql table unless I ran insert.php from the server side.

When I have all three extensions in the php.ini file, I get the following errors:

 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 
+7
php mysqli webserver
Jul 21 '15 at 9:25
source share
4 answers

From your comments, it appears that your extension_dir was installed in /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 fix the problem, you can set extension_dir to /usr/lib/php5/20121212 so that the extension=mysqli.so line extension=mysqli.so the shared object.

+3
Aug 04 '15 at 1:20
source share

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

0
Aug 01 '15 at 6:42
source share

You need to open mysqli service from apache server and then restart apache server

0
Aug 03 '15 at 13:41
source share

Follow this guide.

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04 .

Skip the first step on the apache web server. Please note that the configuration for php cli (command line interface) is in a different file from the configuration for php that your web server uses. If you need to configure php for apache, the default path is /etc/php5/apache2/php.ini in UBUNTU 14.02.

If you continue to experience problems with ioncude, follow this link https://www.digitalocean.com/community/tutorials/how-to-install-ioncube-loader

0
Aug 03 '15 at 17:58
source share



All Articles