Configuration of PHP in Apache environment

Source: Internet
Author: User
Tags insert

PHP is installed in CGI to Apache 2.0:

Insert the following instruction into the Apache httpd.conf configuration file to set up the CGI binaries:

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

PHP is installed in modular mode 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 lines into the httpd.conf.

; For PHP 4 does something like this:
LoadModule php4_module "C:/php/php4apache2.dll"
AddType application/x-httpd-php. php

; For PHP 5 does something like this:
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php. php

Test Apache:

Open the browser and enter http://localhost/or HTTP://127.0.0.1/in the address bar, if you can appear in the Apache page "It works." , it means Apache is working properly.

To test your PHP settings:

Write a PHP page to enter the following code:

<title>
Hello
</title>
<body>
<?php echo "hello,php";?>
<P>PHP5 is work!</p>
</body>

Save this file as ***.php in the Apache Htdocs directory (you can change the directory in the http.conf file), open the browser, and enter http://localhost/***.php or http://in the address bar 127.0.0.1/***.php, if ***,php can display correctly, 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.