How to install mysql extension in php7

王林
Release: 2023-03-06 22:56:02
Original
2890 people have browsed it

How to install the mysql extension in php7: 1. Download the mysql extension; 2. Configure; 3. Execute the [make && make install] command; 4. Edit the php.ini file and add the configuration [extension=pdo_mysql. so].

How to install mysql extension in php7

The specific steps are as follows:

(Video tutorial recommendation: php video tutorial)

1 , Download the mysql extension

2. After decompression, use the phpize tool to initialize (phpize is usually under the php installation directory /bin/)

Execute /www/server in the folder where the extension is decompressed /php/71/bin/phpize

3. Configure

./configure --with-php-config=/www/server/php/71/bin/php-config
Copy after login

4. Compile and install

make && make install
Copy after login

After this step, the system will prompt:

Installing shared extensions: /www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/
Copy after login

The mysql.so we want is in this path.

This path is also the default extension_dir:

PHP default extension_dir path

5. Modify php.ini

Add in the php.ini file One line:

extension=pdo_mysql.so
Copy after login

Save and restart the service.

If you modify extension_dir, you need to copy the mysql.so file to the corresponding path.

Related recommendations: php training

The above is the detailed content of How to install mysql extension in php7. 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