After installing apache2php5, I want to install mysql5. 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. Step 1: Enter the php source code
After installing apache2php5, I want to install mysql5. 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. Step 1: Enter the php source code
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, enter the php source code Directory: # 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 the error is reported in step 2, it is likely that the source code is faulty. I downloaded a new copy from php.net and then compiled it before it passes.