Home  >  Article  >  Backend Development  >  How to install mysql extension in php7

How to install mysql extension in php7

王林
王林Original
2020-04-25 13:23:294430browse

How to install mysql extension in php7

1. Download the mysql extension

http://git.php.net/?p=pecl/database/mysql.git;a=summary

2. Unzip it and initialize it using the phpize tool (phpize is usually under the php installation directory/bin/)

Execute /www/server/php/71/bin/phpize

3 in the folder after the extension is decompressed, configure

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

4, make && make install

After this step is completed, the system will prompt:

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

The mysql.so we want is in this path. This path is also the default extension_dir:

How to install mysql extension in php7

5. Modify php.ini

and add a line to the php.ini file:

extension=pdo_mysql.so

Save and restart the service.

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

For more related tutorials, please pay attention to php Chinese website.

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!

Statement:
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