CATATAN 3 Apache PHP

You might also like

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

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

5 Apache, 2 Version of PHP (concurently)


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

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();
?>

**********************************
Setup Virtual Host for PHP Version
**********************************

1. at C:\Windows\System32\drivers\etc UPDATE host file

127.0.0.1 localhost:90

2. Update the httpd.conf, Open the file and uncomment:


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

3. Also, add port no to start listening ===> Listen 90

4. edit the F:\localserver\Apache24\conf\extra\httpd-vhosts.conf file and ADD


the following content:

<VirtualHost *:90>
ServerAdmin webmaster@local.web
DocumentRoot "F:/localserver/Apache24/htdocs"
ServerName localhost:90
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common

# Use below statement to load the specific version of php configuration


FcgidInitialEnv PHPRC "F:/localserver/php/7.2.13/php.ini"

<Directory "F:/localserver/Apache24/htdocs">
<Files ~ "\.php$">
AddHandler fcgid-script .php
FcgidWrapper "F:/localserver/php/7.2.13/php-cgi.exe" .php
Options +ExecCGI
</Files>
</Directory>
</VirtualHost>

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