Two ways to run PHP on Apache in Windows

Source: Internet
Author: User
    1. # set up aliases for PHP directories

    2. scriptalias/php/"d:/usr/local/php"

    3. # Associate a specific extension to parse the PHP file

    4. AddType application/x-httpd-php. php

    5. # set up a program that uses PHP5 to execute CGI scripts

    6. Action application/x-httpd-php "/php/php-cgi.exe"

Copy Code

2. Run PHP in Apache mode for PHP5, you need to configure the following:

    1. # load PHP5 Module

    2. LoadModule php5_module "D:/usr/local/php/php5apache2.dll"
    3. AddType application/x-httpd-php. php

    4. # Configure the path to the php.ini file

    5. Phpinidir "d:/usr/loca/php"

Copy Code

Once setup is complete, you need to start the Apache server and test it to verify that PHP is working properly. To do this, you need to create a new "phpinfo.php" test program in the Web virtual directory. By default, the virtual directory is located in the Htdocs folder under the Apache directory, such as "D:/usr/local/apache2/htdocs". Here is the contents of the phpinfo.php file:

    1. Phpinfo ();
    2. ?>
Copy Code

Enter in the browser: http://localhost/phpinfo.php, if you can see the PHP version 5 interface, it means that the installation was successful.

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