Skip to content

Instantly share code, notes, and snippets.

@kuflievskiy
Last active May 21, 2021 09:33
Show Gist options
  • Save kuflievskiy/bbd7ebb0824e2c50e34bcc4015e72f0b to your computer and use it in GitHub Desktop.
Save kuflievskiy/bbd7ebb0824e2c50e34bcc4015e72f0b to your computer and use it in GitHub Desktop.
sudo apt-get update
sudo apt-get install php7.3-cgi -y
sudo cp ~/fastcgi/php72 ~/fastcgi/php73
sudo vim ~/fastcgi/php73
# Set version="7.3"
```
#!/bin/sh
# you can change the PHP version here.
version="7.3"
# php.ini file location, */php-5.2.13/lib equals */php-5.2.13/lib/php.ini.
PHPRC=/etc/php/${version}/cgi/
export PHPRC
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
# which php-cgi binary to execute
exec /usr/bin/php-cgi${version}
```
sudo vim /etc/apache2/mods-enabled/fastcgi.conf
```
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
AddHandler php-cgi .php
FastCgiServer /home/dev/fastcgi/php56 -idle-timeout 3600
FastCgiServer /home/dev/fastcgi/php70 -idle-timeout 3600
FastCgiServer /home/dev/fastcgi/php71 -idle-timeout 3600
FastCgiServer /home/dev/fastcgi/php72 -idle-timeout 3600
FastCgiServer /home/dev/fastcgi/php73 -idle-timeout 3600
ScriptAlias /cgi-bin/ /home/dev/fastcgi/
</IfModule>
```
sudo chmod 764 /home/dev/fastcgi/php73
sudo chown www-data:dev /home/dev/fastcgi/php73
sudo vim /etc/apache2/sites-available/zeus.conf
# set new VirtualHost or modify the existing
# Action php-cgi /cgi-bin/php73
sudo apachectl configtest
or
sudo apachectl -t
# Syntax OK
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment