Home > Backend Development > PHP Problem > How to install pdo_mysql extension in php

How to install pdo_mysql extension in php

醉折花枝作酒筹
Release: 2023-03-09 11:14:01
Original
2516 people have browsed it

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

2. Install the PDO_MYSQL component

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

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

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!

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