Home > Article > Backend Development > How to install pdo_mysql extension in php
Method: 1. Download and decompress the php installation package and install the pdo component; 2. Use the cd command to enter the "pdo_myqsl" component directory, specify the "php-config" path and mysql installation path, and use "make & make install "Just install pdo_mysql.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
1. Install PDO components
Unzip the php installation package, enter the pdo component directory, create the php plug-in module through phpize, specify the php-config path, and install pdo.
cd /usr/local/download/php-5.6.23/ext/pdo phpize ./configure --with-php-config=/usr/local/app/php/bin/php-config make & make install
Enter the pdo_myqsl component directory, create a php plug-in module through phpize, specify the php-config path and mysql installation path, and install pdo_mysql.
cd /usr/local/download/php-5.6.23/ext/pdo_mysql phpize ./configure --with-php-config=/usr/local/app/php/bin/php-config --with-pdo-mysql=/usr/ make & make install
There are some pitfalls in specifying the mysql path here, because I installed mysql using yum. I passed the find / -name mysql
and service mysqld status
commands. The mysql path found is not correct and an error message is displayed.
#提示msyql没找到checking for mysql_config... not found configure: error: Unable to find your mysql installation#提示没有mysql_queryconfigure: error: mysql_query missing!?
Later I saw that others had successfully installed it using --with-pdo-mysql=/usr/
. I tried the same and it worked.
If you downloaded the installation package from http://pecl.php.net/package/PDO_MYSQL, decompress the installation file and follow the command in step 2.
Recommendation: "2021 PHP interview questions summary (collection)" "php video tutorial"
The above is the detailed content of How to install pdo_mysql extension in php. For more information, please follow other related articles on the PHP Chinese website!