Windows system environment under one Apache running multiple PHP versions

Source: Internet
Author: User

My personal machine environment is based on Apache2.2 running PHP5.2/4, such as you want to deploy other versions of PHP or more versions between the switch, the same procedure is the same.

According to my environment, the PHP5.2 version is already installed on the machine, so we first re-create the 5.2 service:

    • If you already have a Web Server service running on your machine, you can pause and set it to manual execution (since we are almost no longer running this service by default).
    • Edit the httpd.conf configuration file and add the following form of content

      <ifdefine php5.2>
      # provides php5.2 version DLL path for Apache calls
      LoadModule php5_module "E:/appserv\php5\php5apache2_2.dll"
      # your php5.2 version php.ini path
      Phpinidir "C:/windows/php.ini"
      </ifdefine>

    • Open the cmd command line, switch to your Apache bin directory and execute the following command
      Httpd.exe-k install-n apache_php5.2-d php5.2
    • Now you can restart the new named apache_php5.2 Service, Print phpinfo () in PHP to test whether it is working properly

If the above procedure is correct, you can continue with the PHP5.4 version of the configuration, you will feel a familiar feeling

    • Download the binary version of PHP5.4 and unzip it to the directory you wish to place (the path on my machine is: e:/appserv/php-5.4.37)
    • Edit the httpd.conf configuration file again, adding the following form of content
      <ifdefine php5.4>"E:/appserv/php-5.4.37/php5apache2_2.dll" # php5.4 INI Path (note php5.4 will default to php.ini-production/development two files, personal renamed)"E:/appserv/php-5.4.37/php.ini" </ifdefine>
    • Open the cmd command line and create the Apache service for the php5.4 service
      Httpd.exe-k install-n apache_php5.4-d php5.4

Windows system environment under one Apache running multiple PHP versions

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.