FAQs about PhP and Apache & Mongo

Source: Internet
Author: User
Tags php mysql

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.