Precautions for php configuration in apache Environment

Source: Internet
Author: User

Install PHP in CGI Mode to Apache 2.0:
Insert the following command into the httpd. conf configuration file of Apache to set the CGI binary file:

ScriptAlias/php/"c:/php /"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php/php.exe"

Install PHP in modules to Apache 2.0:
Move php4ts. dll or php5ts. dll to winnt/system32 (Windows NT/2000) or windows/system32 (Windows XP ). Insert the following two rows to httpd. conf.
; For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2. dll"
AddType application/x-httpd-php. php
; For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2. dll"
AddType application/x-httpd-php. php

Test Apache:

Open your browser and enter http: // localhost/or http: // 127.0.0.1/in the address bar. If the Apache page "It works." appears, It means that Apache is working properly.

Test PHP settings:

Write a PHP page and enter the following code:

<Html>
<Head>
<Title>
Hello
</Title>
</Head>
<Body>
<? Php echo "hello, php";?>
<P> php5 is work! </P>
</Body>
</Html>

Save this file ***. php is stored in the htdocs directory of Apache (it can be stored in http. in the conf file), open the browser, and enter http: // localhost/*** in the address bar /***. php or http: // 127.0.0.1 /***. php. If *** php is correctly displayed, the PHP configuration is normal.

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.