.

Friday, April 3, 2020

Running PHP56 web based script on PHP7 environment on Nethserver

I need to run my old PHP script on my server, but this conflict with other web that only run on PHP7x, so I need to add special folder into PHP7 environment, below are how to do this.

First, you must install PHP-SCL from this reference https://wiki.nethserver.org/doku.php?id=php-scl

Edit and add following lines at the end of the file /etc/httpd/conf.d/php.conf :


ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
AddHandler php56-fcgi .php
Action php56-fcgi /cgi-bin/php56.fcgi

<Directory /var/www/html/php56>
 DirectoryIndex index.php
 AllowOverride all
 Require all granted
</Directory>


Create file /var/www/cgi-bin/php56.fcgi with following contents:

#!/bin/bash
exec /bin/php56-cgi 

Set executable on the script:

sudo chmod 755 /var/www/cgi-bin/php56.fcgi

ok, now restart php72 

systemctl restart php72-php-fpm

Now add this lines into .htaccess in folder /var/www/html/php56


<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">
SetHandler php56-fcgi
</FilesMatch>


Thats it, now all php files under /var/www/html/php56 will be run as php56 environtment.



References :
https://wiki.nethserver.org/doku.php?id=php-scl
https://www.tuxtips.net/how-to-run-multiple-php-versions-with-apache-on-centos-7-linux/

1 comment:

Marsya said...

Izin promo ya Admin^^

Bosan gak tau mau ngapain, ayo buruan gabung dengan kami
minimal deposit dan withdraw nya hanya 15 ribu rupiah ya :D
Kami Juga Menerima Deposit Via Pulsa
- Telkomsel
- XL axiata
- OVO
- DANA
segera DAFTAR di WWW.AJOKARTU.COMPANY ....:)

Setting DeepCool AK400 Digital CPU fan di Manjaro Linux

  Baru rakit PC dan pakai AK400 Digital untuk CPU fannya, setelah install linux ternyata tulisan digitalnya gak tampil, cari-cari di interne...