Linux under PHP extended PDO compilation installation

Source: Internet
Author: User
Tags phpinfo zts zend

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.