PHP5 + APACHE2.2 configuration _ MySQL

Source: Internet
Author: User
Configure Apache in PHP5 + APACHE2.2

PHP5 + APACHE2.2 configuration

When I was a beginner in php, I had a problem with the configuration. I found a good post and tried it. so I switched it with me.

However, I still found a problem in this article when installing phpMyAdmin, that is, if php. ini is placed under system32, it will be reported when phpMyAdmin is started.

"Cannot loadMysqlExtension. Please check your PHP configuration. "This error should actually be put in the WINDOWS directory, so there is no

Problem (I am using Windows 2003 ).

The content of the post is as follows:

Source: http://hi.baidu.com/oyej/blog/item/d5b934344497d23a5bb5f5c5.html#send

PHP5 + APACHE2.2 successful configuration case:
1. install and configure APACHE (for example, install Apache on E:/Program Files/APACHE Software Foundation/Apache2.2)
1. it is installed by default during installation. for Network Domain and Server Name, enter my computer Name and your Email Address in the Administrator's Email Address area.
2. after installation, there will be a conf folder in the installation directory. open the httpd. conf file for configuration.
· Find DocumentRoot and set it to the folder where you want to store php, htm, and other Web Files, such as "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs ";
· Find the DirectoryIndex, add index. php and index.htm after index.html, and separate it with a single space;
· Restart Apache and use http: // localhost/or http: // 127.0.0.1/or http: // yourcompanyname/to test whether the operation is successful. If It succeeds, there will be an It works on the screen!
2. install and configure PHP (decompress the PHP compressed package to d:/php /)
1. set php. rename the ini-recommended file to php. ini and cut it to the system directory (for example, in the Windows/system32 directory of 2000/NT, WINNT/system32 directory of XP ),
2. change extension_dir to the directory where php/ext is located, for example, "d:/php/ext ";
3. change doc_root to the same directory in step 1, for example, "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs ";
4. find; session. save_path = "/tmp", remove ';' and set the directory where you saved the session, such as session. save_path = "D:/php/session_temp ";
5. remove the semicolon in the following sentence to better support Mysql and PHPmyadmin.
Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dll
Third, PHP + APACHE
1. Apache is allowed to run PHP programs as modules:
Open httpd. conf and add the following content (any location ):
LoadModule php5_module "d:/php/php5apache2_2.dll" (special feature). In many cases, php5apache2.dllis used. in this case, an error occurs when the php code is run)
AddType application/x-httpd-php. php
AddType application/x-httpd-php. htm
(.Htm,. php can be used as the extension of the executable php language, and html, php3, php4, or even txt can be added)
(The following two steps are not required)
2. if you run the PHP program (use php.exe) in the cgimodel for a specific reason ),
Change the above line to a comment (add # to each line header) and add the following lines:
# ScriptAlias/php/"d:/php /"
# AddType application/x-httpd-php. php
# Action application/x-httpd-php "/php/php-cgi.exe"
3. now apache 2 supports HTML but does not support PHP. add the following sentence to d:/apache2/conf/httpd. conf:
# ScriptAlias/php/"d:/php /"
# AddType application/x-httpd-php. php
# Action application/x-httpd-php "/php/php-cgi.exe"

4. restart the service
1. find php5ts in d:/PHP. dll, libmysql. dll copies it to c:/winnt/system32 (winNT/2000), while winXP/2003 copies it to c:/windows/system32
2. test whether the connection between Apache and php is successful:
Start the start apache service or restart the restart apache
3. create test. php under the Web root directory (E:/Program Files/Apache Software Foundation/Apache2.2/htdocs)

<Head>Test
<Body>
<? Php
Phpinfo ();
?>
</Body>
</Html>

4. run http: // localhost/test. php
If it succeeds, you should see a webpage containing the PHP logo, which contains a lot of settings and other information.
Congratulations!

Note:
If it cannot run, it cannot be started after PHP5.1. * + apache 2.2.2 is installed using the traditional modular method,

Tip:
"Cannot load D:/php/php5apache2. dll into server: The specified module cocould not be found ."

Cause:

The php5apache2. dll in the PHP compressed package is only applicable to apache2.0.*. do you want to change php5apache2. dll to php5apache2_2.dll, which is the 1st small step in step 3?
Other solutions:

Download (http://www.phpv.net/php5apache2.dll-php5.1.x.rar) and unzip. There are three files.

Vcredist_x86.exe
Php5apache2. dll
Httpd.exe. manifest
1. overwrite php5apache2. dll to the php5apache2. dll file in your original PHP directory.
2. copy the httpd.exe. manifest file to the bin folder under your apache installation directory.
3.install vcredist_x86.exe in double-hitting mode.
Done! Restart apache.

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.