How to install mysqli on centos php

藏色散人
Release: 2020-08-17 10:14:23
Original
4063 people have browsed it

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".

How to install mysqli on centos php

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 take installing mysqli as 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/
Copy after login

Then run phpize

/usr/local/nginx_php-5.2.17/bin/phpize
Copy after login

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
Copy after login

Installation

make && make install
Copy after login

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/"
Copy after login

If not, add

and add another one:

extension=mysqli.so
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!