php5+apache2.2 method

Source: Internet
Author: User
Tags php code

php5+apache2.2 method

Let me take a look at the static configuration method.
Rewriteengine on
Rewriterule/rent/d-(d+). html$/rent/detail.php?id=$1
Rewriterule/newhouse/d-(d+). html$/newhouse/detail.php?id=$1
Rewriterule/sale/d-(d+). html$/sale/detail.php?id=$1
rewriterule/shop/(d+)/shop/profile.php?id=$1
rewriterule/shop/e-(d+). html$/shop/evaluate.php?id=$1
rewriterule/shop/p-(d+). html$/shop/profile.php?id=$1
rewriterule/community/g-(d+). html$/community/general.php?id=$1
rewriterule/community/p-(d+). html$/community/photo.php?id=$1
rewriterule/community/e-(d+). html$/community/edit.php?id=$1
rewriterule/newhouse/s-(d+). html$/newhouse/structure.php?id=$1
rewriterule/newhouse/p-(d+). html$/newhouse/photo.php?id=$1


First, install and configure Apache (in my case, install to E:program filesapache Software FoundationApache2.2)
1, install the default installation, network Domain, Server name I fill out my Computer name, Administrator ' s email address area to fill in your email addresses
2, after installation in the installation directory under the Conf folder, open httpd.conf file for configuration
• Find DocumentRoot, set it up for you to store PHP, HTM and other Web Files folder, such as "E:program Filesapache Software Foundationapache2.2htdocs";
• Find DirectoryIndex, add index.php, index.htm after index.html, and separate them with a single space;
• Restart Apache and test for success with http://localhost or http://127.0.0.1 or http://yourcompanyname. The success of the screen will have an IT works!
Second, install the configuration of PHP (decompression PHP compression package to d:php)
1, rename the php.ini-recommended file to php.ini and cut it to the system directory (such as 2000/nt winnt/system32, xp windows/system32 directory),
2, change the Extension_dir to Php/ext directory, such as "D:phpext";
3. Change the doc_root to the same catalogue in the first step, such as "E:program Filesapache Software Foundationapache2.2htdocs";
4, find Session.save_path = "/tmp", will '; ' Remove, set the directory where you save the session, such as Session.save_path = "d:/php/session_temp";
5, then remove the semicolon in front of the following sentences to better support MySQL and phpMyAdmin
Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dll
Third, Php+apache
1, allows Apache to use PHP program as a module to run:
Open httpd.conf and add the following (anywhere):
LoadModule php5_module "D:/php/php5apache2_2.dll" (pay special attention to this one, many places is called Php5apache2.dll, so that when running PHP code prompts httpd.exe application error)
AddType application/x-httpd-php. php
AddType application/x-httpd-php. htm
(. htm,. php Extensions for executable PHP languages, plus HTML, php3, PHP4, and even txt)
(The following two steps may not be required)
2. If you need to run the PHP program in CGI mode for some reason (using Php.exe),
Please turn the above line into a note (each wardrobe plus #) 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 support HTML and do not support PHP, first add the following sentence to d:apache2confhttpd.conf:
# scriptalias/php/"d:/php/"
# AddType application/x-httpd-php. php
#Action application/x-httpd-php "/php/php-cgi.exe"

Four, restart service
1, in d:php find Php5ts.dll,libmysql.dll copy it to the C:winntsystem32 (winnt/2000 machine), and winxp/2003 is copied to C:windowssystem32
2, Test Apache and PHP are connected successfully:
Start the start Apache service or restart restart Apache while it is running
3, under the Web root directory new test.php (that is, E:program Filesapache Software Foundationapache2.2htdocs)
<body>
<?php
Phpinfo ();
?>
</body>
4. Operation http://localhost/test.php
If successful, you should see a Web page with a PHP logo that contains a number of settings and other information
Well, congratulations.
Note:
If not, the traditional modular method of installing php5.1.* + Apache 2.2.2 cannot be started,
Tips:
"Cannot load D:/php/php5apache2.dll into server:the specified module could not is found."
Reason:
PHP Compression Package Php5apache2.dll only apply to apache2.0.*, whether the Php5apache2.dll to Php5apache2_2.dll that is the third step of the 1th small step
Another solution:
Download (Http://www.phpv.net/php5apache2.dll-php5.1.x.rar) and unzip. A total of three files.
Vcredist_x86.exe
Php5apache2.dll
Httpd.exe.manifest
1. Overwrite the Php5apache2.dll file in your original PHP directory with the Php5apache2.dll.
2. Copy the Httpd.exe.manifest file to your Apache installation directory under the Bin folder.
3. Double-click to run Vcredist_x86.exe installation.
Go ahead and reboot your Apache try it.

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.