This article describes the method for compiling and installing PHP Extensions PDO Linux (CentOS). Share to everyone for your reference, specific as follows:
Here is CentOS, for example, the Red Hat series of Linux methods should be the case, the following detailed steps, here seriously despise what content long-winded, said assorted about PDO compile installation articles.
1, into the PHP package PDO extended Directory (note: Not the PHP installation directory)
[Root@gamejzy/]# cd/tmp/lamp/php-5.3.19/ext/pdo_mysql/
Note: My PHP package is under/tmp/lamp/php-5.3.19
Execute phpize command
[Root@gamejzy pdo_mysql]#/usr/local/php/bin/phpize
Note:/usr/local/php is my PHP installation directory
After the phpize command is executed, the Pdo_mysql directory appears configure
Perform configuration
Copy Code code as follows:
[Root@gamejzy 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 Specifies the configuration when installing PHP
--with-pdo-mysql=/usr/local/mysql/Specify the location of the MySQL database installation directory
Compiling the installation
[Root@gamejzy pdo_mysql]# make && make install
After the compilation is complete, be aware of the presence of information similar to the following picture
If you see a successful compilation installation, be very careful about the directory where the red line is circled (note: The directory name may not be the same for different time periods).
After the compile installation is complete, the generated pdo_mysql.so files are placed in this directory.
2. Modify php.ini File
Use VI to open your machine's php.ini file, adding a section of code "extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so" , loading the pdo_mysql.so file
The effect of the following figure:
Save Exit Edit!
3, view phpinfo ()
Restart the Apache server first. Use the Phpinfo () function to view the installation information for PHP, as shown in the following illustration to show that PDO extended installation was successful.
It's over!
More interested in PHP related content readers can view the site topics: "Php Curl Usage Summary", "PHP operation and operator Usage Summary", "PHP Network Programming Skills Summary", "PHP Basic Grammar Introductory Tutorial", "PHP operation Office Document skills Summary (including Word, Excel,access,ppt), "The PHP date and time usage summary", "PHP object-oriented Programming Introduction Tutorial", "PHP string (String) Usage Summary", "Php+mysql Database operation Introduction Tutorial" and "PHP common database Operation skill Summary"
I hope this article will help you with the PHP program design.