1. php -- version and phpinfo () versions are inconsistent.
Generally, this problem occurs after PHP is reinstalled. The solution is very simple. You can reinstall PHP and Apache. before reinstalling PHP and Apache, RM will drop PHP and Apache. If it comes with the system, in the Rh series, you can use rpm-Qa | grep httpd and rpm-Qa | grep PHP to uninstall all the files through grep-e. Previously, the two services httpd stop and apachctl stop were closed, and the reinstallation was OK. Pay attention to the compilation options during reinstallation:
Note the following when installing Apache:
./Configure -- prefix =/usr/local/Apache -- enable-module = so -- enable-module = rewrite -- enable-shared = max
In addition, after installation, you need to add it to httpd. conf.
VI/usr/local/Apache/CONF/httpd. conf <ifmodule mod_mime.c> addtype application/X-httpd-PHP. PHP addtype application/X-httpd-PHP-source. PHPs <ifmodule>
PHP: Configure:
./Configure -- prefix =/usr/local/PHP -- with-apxs2 =/usr/local/Apache/bin/apxs
After the installation is successful, add register_globals = on to PhP. ini.
Restart apachectl restart to use PHP.
2. install PHP Mongo
PHP Mongo installation can see: http://www.php.net/manual/en/mongo.installation.php
In the beginning, PECL, or PECL install Mongo, was used to save time for graph. However, after installation, it was found that Mongo. So was not found. Then, the source code was downloaded directly for installation.
Phpize./configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config
After installation, change the extension_dir path of modules of PHP. ini to/usr/local/PHP/modules/
Add extension = "Mongo. So" to the last row"
Then copy the generated Mongo. So and restart the apache service. Probably OK.
You can use PHP-I | grep-I Mongo to check whether Mongo is successfully loaded. so if "php startup: Unable to load dynamic library" is reported, it may be Mongo. so version or failure to load.
3. install PHP MySQL... so .........
PHP calls MySQL. so, after PHP is installed. rename INI and put it under PHP/lib to modify PHP. INI with extension = MySQL. so, MySQL. use phpize to run phpize in ext/MySQL in the PHP source code directory, and then run
./Configure -- With-PHP-Config =/usr/local/php524/bin/PHP-config -- With-mysql =/usr/local/MySQL/
Again
Make; make install
Run php according to the PHP Module Directory to check whether the program is successful!