Learn how to install mysql extension in centos
- # 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, here is/usr/local/php5/lib/php/extensions/no-debug-zts-20090626), and then modify php. ini, remove the semicolon before extension = php_mysql.so. Note: the generated module is mysql. so, which is different from php_mysql.so in php. ini. 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 may be a source code problem. You can download a new file from php.net and recompile it. |