: This article mainly introduces how to add pdo_mysql extension for php in centos. if you are interested in the PHP Tutorial, refer to it. Step 1: Go to the ext/pdo_mysql directory under the php source code directory (here is the source code directory, not the installation directory, note the difference)
Step 2: Run: # {$ php_indtall_dir}/bin/phpize
Note: Here {$ php_indtall_dir} refers to the php installation directory. if/usr/local/php is installed, run/usr/local/php/bin/phpize, here is the generation. configure
Step 3: compile the file:
./Configure -- with-php-c/span> # usr/local/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql
Note: Both the php and mysql directories are installation directories, which can be modified as needed.
Here we also need to make a soft link for the mysql header file, because the installation directory is specified during mysql installation, no link is left, and the header file cannot be found.
# Ln-s/usr/local/mysql/include/*/usr/local/include/
Then, if make & make install is successful, a prompt is displayed:
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Step 4: modify php. ini
Add the following two rows:
Extension = pdo_mysql
Extensi>/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Step 1: restart php-fpm and restart nginx or apache.
The above introduces how to add pdo_mysql extension for php in centos, including some content. I hope my friends who are interested in PHP tutorials can help me.