1 , into the PHP package PDO Extension directory (Note: not php installation directory)
[email protected]/]# /home/tdweb/php-5.4.34/ext/pdo_mysql
Execute phpize command
[Email protected] pdo_mysql]#/usr/local/php/bin/phpize
Note:/usr/local/php is my php installation directory
Configuring for:
PHP Api version:20100412
Zend Module Api no:20100525
Zend Extension Api no:220100525
When you finish executing the phpize command, the pdo_mysql directory will appear configure
Perform configuration
[Email protected] pdo_mysql]#/configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/ local/mysql/
Parameter description:
--with-php-config=/usr/local/php/bin/php-config Specify the configuration when PHP is installed
--with-pdo-mysql=/usr/local/mysql/ specifying the installation directory location for the MySQL database
Compiling the installation
[[email protected] pdo_mysql]# make && make install
After the compilation is complete, notice that the information similar to the following is displayed
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
If a description appears stating that the compilation installation was successful (note: The directory name may be different for various time periods).
After the compilation installation is complete, the generated pdo_mysql.so file is placed in this directory.
2 , modify the php.ini file
Use VI to open your machine's php.ini file and add a piece of code "extension=/usr/local/php/lib/php/extensions/ No-debug-non-zts-20100525/pdo_mysql.so ", loading pdo_mysql.so file
Effects such as:
Save Exit Edit!
3 , view phpinfo ()
Restart the Apache server First (if not, restart PHP). Use the phpinfo () function to view the installation information for PHP, as shown in the description of the PDO extension installation success.
Linux under PHP extended PDO compilation installation