Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Created May 27, 2023 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepeviktor/477c0c2647881e39386121830631dde5 to your computer and use it in GitHub Desktop.
Save szepeviktor/477c0c2647881e39386121830631dde5 to your computer and use it in GitHub Desktop.
Apache configuration for dual PHP
Define SITE_USER linux_user
Define DOCUMENT_ROOT "/home/${SITE_USER}/website/code"
<IfModule mod_proxy_fcgi.c>
DirectoryIndex disabled
DirectoryIndex index.html index.php
ProxyRequests Off
# PHP 5
ProxyPass "/forum" "unix:///run/php5-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}/forum/index.php"
ProxyPass "/forum/" "unix:///run/php5-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}/forum/"
# PHP 7
ProxyPassMatch ".+\.php$" "unix:///run/php/php7.3-fpm-${SITE_USER}.sock|fcgi://localhost${DOCUMENT_ROOT}"
<Proxy "fcgi://localhost">
ProxySet connectiontimeout=5 timeout=65
</Proxy>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment