Php Server environment construction method

Source: Internet
Author: User
Php Server environment construction method

  1. Loadmodule php5_module d: \ php5 \ php5apache2_2.dll

2. you can modify the documentroot parameter to modify the root directory of the server's main document. the original root directory is apache2.2 \ httdocs. For example, after modifying the documentroot parameter of documentroot "d:/phpserver", you need to modify the following:

  1. To:
  2. Apache2.2 \ httdocs

3. add the apache server extension: find the following code:

  1. Allowoverride none
  2. Options none
  3. Order allow, deny
  4. Allow from all

Add addtype application/x-httpd-php. php to the end of this code. the extensions that php can recognize include php3,. php3, php, and phtml. Only the standard extension. php is recommended.

4. modify the preview display page, and the apacheparts display page is index.html. Find the directoryindex and modify the parameters as follows:

  1. Directoryindex index. php

5. modify the apaceh Port. the default value is 80. find listen and modify the parameters. if you want to modify the port to 82: listen 82, restart the apaceh server. However, to display php webpage files, it still does not work.

Install php 1 and decompress the php5 installation file to the corresponding directory. For example, d: \ hph5. 2. copy all dll files under this directory (php5 directory) to the windows \ system32 directory on the system disk. 3. copy the php. ini-dist file in the directory to the system disk \ windows directory and rename it php. ini. 4. open the php. ini diploma and find "extension_dir ="./"and change it to" extension_dir = "d:/hph5/ext "". 5. locate the line "; extension = php_mysal.dll" and remove the semicolon. In this way, php supports the mysql database. 6. now, php is configured and the apache server is restarted.

Test: compile a php script file named phpinfo. php and save it to the virtual root directory d:/phpserver of the apache server. Php script file code:

  1. Phpinfo ();
  2. ?>

Test: enter http: // localhost/hphinfo. php in the address bar of the browser. if the php version information is displayed, the php server is successfully set up. Php and mysql server configuration instructions php Server Status Check implementation code php method for getting server time php method for getting server information alternative method php method for getting server information a piece of code for getting server information

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.