This article uses CentOS as an example. The Red Hat series Linux methods should all be like this. The following describes the steps in detail, which of the following articles about PDO compilation and installation are severely despised here. 1. Go to the pdo extension directory of the PHP Software Package (Note: it is not the PHP installation directory) [root @ gamejzy] # cdtmplam
This article uses CentOS as an example. The Red Hat series Linux methods should all be like this. The following describes the steps in detail, which of the following articles about PDO compilation and installation are severely despised here. 1. Go to the pdo extension directory of the PHP Software Package (Note: it is not the PHP installation directory) [root @ gamejzy/] # cd/tmp/lam
This article uses CentOS as an example. The Red Hat series Linux methods should all be like this. The following describes the steps in detail, which of the following articles about PDO compilation and installation are severely despised here.
1. Go to the pdo extension directory of the PHP Software Package (Note: it is 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
Run the 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, configure appears in the pdo_mysql directory.
Execute Configuration
[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 during PHP installation
-- With-pdo-mysql =/usr/local/mysql/Specify the installation directory of the MySQL database
Compile and install
[root@gamejzy pdo_mysql]# make && make install
After the compilation is complete, check whether the information similar to that shown in slices appears.
Note that the compilation and installation are successful.Red LineCircled directory (note: the directory names may be different in different time periods ).
After compilation and installation are complete, the generated pdo_mysql.so file is placed in this directory.
2. Modify the php. ini file
Use vi to open the php. ini file on your machine, add a piece of code "extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so", load the pdo_mysql.so File
The effect is as follows:
Save and exit editing!
3. View phpinfo ()
Restart the Apache server. Use the phpinfo () function to view the php installation information, as shown in. The PDO extension is successfully installed.
This is the end. Please leave a message if you have any questions!
!!