Apache Virtual host PHP server configuration using Apache and IIS two methods

Source: Internet
Author: User
Tags php server
First, using Apache
Installation of ≡php 5.2.5 ≡
1, to its official site download Php-5.2.5-win32.zip and decompression (said: Do not download and use its installer, this way although very automated, very smart, but there are many limitations, because it is not recommended. ) to a directory "D:\PHP\PHP".
Copy the php.ini-recommended from the PHP directory (D:\PHP\PHP) to Windows (some systems are WINNT directories) and rename it to PHP.ini, and find Extension_dir, modify it to Extensi, Modifies the default character set, where, if preceded by a semicolon ";", remove the semicolon;
The Register_globals=off is changed to Register_globals=on, making the transitive global variable valid;
Extension=php_dba.dll If there is a semicolon in front, remove the semicolon to the same;
Extension=php_dbase.dll
Extension=php_gd2.dll GD library do diagram, generally used for graphic verification code;
Extension=php_mysql.dll is used to connect MySQL database;
Short_open_tag=on Support And , off for support only
Copy the Php5ts.dll and Libmysql.dll (for MySQL) files in the D:\PHP\PHP directory to the Windows system folder, namely: C:\windows\system32.
Installation of ≡apache 2.2.8 ≡
1, to its official site download Apache_2.2.8-win32-x86-no_ssl.msi and execute.
Press the Next button 3 times, the installation program requires you to enter your network domain (Web domains), server domain (server domains) and webmaster e-mail, some words are filled out truthfully, this note describes the local self-built test environment, so casually, the first two fill localhost, mail write your own can.
After entering next, the default installation path is "C:\Program Files\apache software foundation\apache2.2\", modify the path and change to the "D:\PHP\Apache2.2" you want.
Then go all the way down to the end of the installation; At this point, open the PHP folder under D, and you will see a folder named Apache2.2.
2, open IE, and then enter in the Address bar: "http://localhost" or "http://127.0.0.1" can see the Apache installation completed Success page;
3. Configuration of conf/httpd.conf files
1) Look for "DocumentRoot", which is the directory where the home page is located. The default is: "D:\PHP\Apache2.2\htdocs", you can use the default directory, you can also define one, such as: "d:/php". Note: Do not add "/" at the end of the directory.
2) Find "DirectoryIndex", here is the default home page name, you can add index.php and so on after index.html. Multiple filenames are separated by a space.
3) Find

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all

Modified to:

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all

If you do not change this here, you may appear that you do not have permission to access/on the this server. This error message, especially after changing the path of the default home page.
4) Create a virtual directory
Found it ...
Add Alias/webpath "D:\PHP\Apache2.2\phptxt"

Options MultiViews
AllowOverride None
Order Allow,deny
Allow from all

Where/webpath is the virtual directory name and "D:\PHP\Apache2.2\phptxt" is the file location.
The address of the visit is: http://localhost/webpath/
5) Make the server support PHP, add the following two lines of code in the corresponding location
LoadModule php5_module "D:\PHP\PHP\php5apache2_2.dll"
AddType application/x-httpd-php. php. PhP3. Inc
Note: The httpd.conf file has been modified and needs to be restarted for Apache2.2 to take effect.
Ii. using IIS to parse PHP files
1, ibid., first install PHP 5.2.5.
2. Open IIS Manager, select "Default Web Site", "Properties", Pop-up dialog box select "Home Directory" tab, execute permissions to "scripts and executables", click "Configuration", add application extension mapping, executable file Selection "D:\PHP\PHP\ Php5isapi.dll ", extension". php "and select all actions, Script engine, confirm file exists.
For the Win2003 system, you also need to add a Web service extension that requires a file of "D:\PHP\PHP\php5isapi.dll" with the extension "PHP" and the condition changed to allow.

The above describes the Apache virtual host PHP server configuration using Apache and IIS two methods, including the Apache virtual host content, I hope to be interested in PHP tutorial friends helpful.

  • 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.