Fatal error:class ' mysqli ' not found in solution

Source: Internet
Author: User

Server solutions are simple in Windows

Solving method

Get rid of the php.ini inside.

The code is as follows Copy Code

Extension=php_mysqli.dll

The semicolon in front of this line ";" and then restart the Iis/apache, it's OK, if it's still not OK we can php_mysqli.dll the PHP directory to the System32 directory, another open mysqli expansion, that is, the php.ini; Extension=php_mysqli.dll before the semicolon removed, restart the service, it should have.

And then restart Iis/apache.

Solution in Linux is a little more complicated, because it's all command mode.

The code is as follows Copy Code


CD php-5.2.8//There's a mysqli in the Ext folder underneath.
CD Ext/mysqli

Linux will be the source file compiled should have configure it, but here is not, after we have installed PHP, php5 folder in the command directory bin there is a file called phpize, use it can generate configure files, continue to

The code is as follows Copy Code

/usr/local/php5/bin/phpize//Here Enter the run, after the execution of the Configure file,
./configure–prefix=/usr/local/mysqli–with-php-config=/usr/local/php5/bin/php-config–with-mysqli=/usr/local/ Mysql/bin/mysql_config

Direct return, no problem will continue.

The code is as follows Copy Code

Make
Make Test
Make Install//(no error will show installing shared extensions:/usr/local/php5/lib/php/extensions/no-debug-non-zts-20041030/)

Now the mysqli.so file is coming out.

It's OK to load this file directly in the php.ini.

The code is as follows Copy Code

Extension_dir= "/usr/local/php5/ext"
Extension=mysqli.so

Find the first line above to change to this, and then add the second line. Wq Save exit.

mysqli.so this file CP to/usr/local/php5/ext.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.