After installing apache2 + PhP5, I want to install mysql5 again.
After installing mysql5 with the source code, I found that I wanted to add new extensions for PHP in Linux. Unlike in windows, I just needed to remove the semicolon comment ~
I found a lot of information on the Internet and finally got it done. Close up the diary to congratulate me.
To add an extension, follow these steps:
1. Go to PhPSource codeDirectory: # cd/usr/chenshao/php-5.3.1/
2. Go to the MySQL extension source code directory to be added: # cd EXT/MySQL/
2. Call phpize in compiled PHP: #/usr/local/PhP5/bin/phpize
3. Then, configure: #./configure -- With-PHP-Config =/usr/local/PhP5/bin/PHP-config -- With-mysql =/usr/local/MySQL
(/Usr/local/MySQL is the installation directory of MySQL)
4. Make & make install
5. After compilation, MySQL is automatically loaded. so to the default PHP extension directory (phpinfo can be viewed, my/usr/local/PhP5/lib/PHP/extensions/no-debug-zts-20090626), and then modify PHP. INI, remove the semicolon before extension = php_mysql.so.
Note that the generated module is namedMySQL. SoIn PHP. iniPhp_mysql.soThe names are inconsistent. You must change mysql. So to php_mysql.so. Remember to remember ~!
6. Restart Apache: # service httpd restart
NOTE: If Step 1 passes, but step 2 reports an error, it is likely that the sourceCodeProblem, I downloaded a new copy from php.net and then compiled it.