About the working mechanism between PHP and MySQL, today the egg hurts to consider the PHP compilation installation without adding the--with-mysql parameter, whether you can implement the mysql_connect () function.
The first compilation is simple
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etcmake && make install
Mysql_connect () did not use, originally want to install Php-mysql yum, think for a long time no extension compiled.
And then began to toss.
CD Ext/mysql/usr/local/php/bin/phpize./configure-with-php-config=/usr/local/php/bin/php-config--WITH-MYSQL=/USR /local/mysql
Then in the configuration file php.ini add extension, decisive encounter error.
notice:php message:php warning:php Startup:invalid Library (maybe not a PHP library) '/usr/local/php/lib/php/extensio Ns/no-debug-non-zts-20090626/mysql.so ' in Unknown on line 0
Tossing the Extension,extension_dir two options, all combinations have been used. Had to on the search engine, two hours later still did not find the solution on the Internet. At this time to focus on the PHP installation, the above PHP is already a second installation. Previously only did delete the installation directory, the source package files continue to be extracted before the use.
rm-rf/usr/local/php
And then, one more time.
RM src-rf (Memory is too bad, this time forget to delete the installation directory/usr/local/php) tar zxvf php-5.x.x.tar.gzcd php-5.x.x./configure--prefix=/usr/local/php- -with-config-file-path=/usr/local/php/etcmake && make Install
CD Ext/mysql/usr/local/php/bin/phpize./configure-with-php-config=/usr/local/php/bin/php-config--WITH-MYSQL=/USR /local/mysql
The configuration file was not moved because the installation directory was not deleted.
Test, success. Suddenly feel good pits, their own pits do not remove the source code decompression package, PHP website pits do not reset some environment.