Control Web Panel
WebPanel => PHP Selector => Topic started by: jcasilva on August 07, 2016, 12:14:44 PM
-
Hi everyone!
I need enable the php 7.0.9 only in one site. I am try to use this sintax below, but without success. When i put this commands in htaccess the PHP 7.20 DEV appears. How can i enable 7.0.9 version?
thanks!
AddHandler application/x-httpd-php7 .php
AddType application/x-httpd-php7 .php5 .php4 .php .php3 .php2 .phtml
-
It is a tricky thing to get PHP version working, I have been beating my head around for few days, but finally I have found a kind of workaround.
I was however not able to make a different version of PHP as default and I think the Menu Item PHP Version Switcher is pretty much useless, or at least for me it was, even after many attempts I was unable to get it working.
But here is how I got things working
1. Goto PHP -> PHP Selector
(http://i63.tinypic.com/rvkoyg.png)
2. Click Install Dependencies
3. Select all the versions that you may want to use for some website and Hit Start Compiler
It will take some time to compile, you can see the progress by typing tail -f /var/log/php-selector-rebuild.log in your SSH terminal. Once it is completed, You are ready for the next step.
4. ADD PHPx Handler through .htaccess file where you want to change PHP version, remember the version you want to use must be compiled first using the above method.
in my case I wanted to use PHP7 so here is what I added to my .htaccess
AddHandler application/x-httpd-php7 .php .php5 .php4 .php3
for me that was all I needed to do and I was able to use PHP 7 under this directory.
Go ahead try, I hope it will work, if doesn't post back. maybe someone can help.
Have a Nice Day
-
oh, and don't forget restarting apache for this to work
-
btw, what is different betwen
AddHandler application/x-httpd-php7 .php .php5 .php4 .php3
with AddHandler application/x-httpd-php7
-
well, I am not some guru, myself am pretty much just-get-it-done-guy but I would say
AddHandler application/x-httpd-php7 .php .php5 .php4 .php3
tells Apache whilch file types (identified by extension .php .php5 etc) to be treated as PHP Applications or applications/x-httpd-php7
the other one is possible an incomplete command
that's my guess until someone posts a better response
-
Hello Waryah, your config not running in my server CWP version: 0.9.8.54
i'm use script on .htaccess
AddHandler application/x-httpd-php7 .php .php5 .php4 .php3
but dont' work
or script
AddHandler application/x-httpd-php7 .php
don't work again.
but, in CWP version: 0.9.8.14 ago it's work.
there is something wrong ?
Thanks