- # CD/USR/CHENSHAO/PHP-5.3.1/
Copy Code2. Enter the MySQL extension source directory you want to add:
- # CD ext/mysql/
Copy Code2. Call the phpize in the compiled PHP:
- #/usr/local/php5/bin/phpize
Copy Code3, then configure:
- #./configure--with-php-config=/usr/local/php5/bin/php-config--with-mysql=/usr/local/mysql
- (/usr/local/mysql is the MySQL installation directory)
Copy Code4.
- Make && make install
Copy Code5, 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:
- # Service httpd Restart
Copy CodeNote: 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. |