Home>Article>Operation and Maintenance> How to install mysqli on centos php
How to install mysqli in centos php: first enter the php source code package; then run phpize in the php installation directory; then compile and install the "mysqli" extension; finally add the content "extension" to the "php.ini" file =mysqli.so".
Recommended: "centos tutorial"
When compiling and installing php under centos, sometimes we often forget Some extensions, such as pdo, mysqli, but we cannot find the corresponding extension file (.so file) in the extension directory. In this case, we can only compile and install the module, generate the corresponding so file, and then Add the corresponding extension record to php.ini and restart php
. Let’s takeinstalling mysqlias an example.
First enter the php source code package. If you can’t find it, you can download an address here: http://us2.php.net/get/php-5.2.17.tar.gz/from/a/mirror
Unzip
tar xvzf php-5.2.17.tar.gz cdphp-5.2.17/ext/mysqli/
Then run phpize
/usr/local/nginx_php-5.2.17/bin/phpize
in the php installation directory (search according to your own php installation directory, not necessarily this directory, if not found, You can view it according to phpinfo()
Then compile and install the mysqli extension
#./configure --prefix=/usr/local/mysqli --with-php-config=/usr/local/nginx_php-5.2.17/bin/php-config --with-mysqli=/usr/local/mysql/mysql_config
Installation
make && make install
Then the mysqli.so file has been generated in the extension directory of php
Open the php.ini file and see if there is the following content
extension_dir = "/usr/local/nginx_php-5.2.17/lib/php/extensions/no-debug-non-zts-20060613/"
If not, add
and add another one:
extension=mysqli.so
Save.
Restart php. You can see that mysqli has been installed.
The above is the detailed content of How to install mysqli on centos php. For more information, please follow other related articles on the PHP Chinese website!