Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

========================================

1 Apache, 2 Version of PHP (concurently)


========================================
1. Create PHP folder
2. Rename file php.ini-development into php.ini
3. Open the httpd.conf, located at F:\localserver\Apache24\conf
4. Search the following modules in this file, if available then uncomment
(remove the # symbol from the starting) it otherwise add those modules.

# LoadModule include_module modules/mod_include.so


# LoadModule vhost_alias_module modules/mod_vhost_alias.so
# LoadModule fcgid_module modules/mod_fcgid.so

5. Open the httpd-default.conf, located at F:\localserver\Apache24\conf\extra


Add the following code snippet at the bottom of the file:

FcgidInitialEnv PATH
"F:\localserver\php\7.3.0;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 50
FcgidMaxRequestLen 8131072
# Location of php.ini
FcgidInitialEnv PHPRC "F:\localserver\php\7.3.0"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
<Files ~ "\.php$">
AddHandler fcgid-script .php
FcgidWrapper "F:/localserver/php/7.3.0/php-cgi.exe" .php
Options +ExecCGI
</Files>

In the above code snippet, we are just creating a default configuration of our
apache server.
Currently, we are setting up the PHP version 7.3 as our default PHP version.

6. You may change the PHP path as per your requirement such as
“F:\localserver\php\7.3.0” or “F:\localserver\php\7.2.13”.

7. Add httpd-default.conf in the httpd.conf. Open httpd.conf and apply the


changes as given below.

# Include conf/extra/httpd-default.conf
to
Include conf/extra/httpd-default.conf

8. Create a new file phpinfo.php at F:\localserver\Apache24\htdocs with the


following content.
<?php
echo phpinfo();
?>

In the above code snippet, We are using “FcgidInitialEnv PHPRC” statement


to load the specific PHP config (php.ini) file.

5. Install Service: httpd.exe -k install -n Apache24_php74

6. Start Service: httpd.exe -k start -n Apache24_php74

AH00558: httpd.exe:
Could not reliably determine the server's fully qualified domain name,
using fe80::6576:7baa:d865:812a. Set the 'ServerName' directive globally to
suppress this message

You might also like