Learn to install PHP MySQL extensions for CentOS

Source: Internet
Author: User
Tags php mysql
    1. # CD/USR/CHENSHAO/PHP-5.3.1/
Copy Code

2. Enter the MySQL extension source directory you want to add:

    1. # CD ext/mysql/
Copy Code

2. Call the phpize in the compiled PHP:

    1. #/usr/local/php5/bin/phpize
Copy Code

3, then configure:

    1. #./configure--with-php-config=/usr/local/php5/bin/php-config--with-mysql=/usr/local/mysql
    2. (/usr/local/mysql is the MySQL installation directory)
Copy Code

4.

    1. Make && make install
Copy Code

5, after compiling, automatically put mysql.so in the default PHP extension directory (Phpinfo can view, here is/usr/local/php5/lib/php/extensions/no-debug-zts-20090626), Modify PHP.ini, remove, extension=php_mysql.so the semicolon in front of it. Note: The generated module named Mysql.so, with php.ini inside the php_mysql.so name inconsistent, must be renamed to Php_mysql.so Mysql.so, remember to remember ~! 6. Restart Apache:

    1. # Service httpd Restart
Copy Code

Note: If the 3rd step is passed, but the 4th step is an error, the source code may be the problem. You can download a new file from Php.net and recompile it.

  • 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.