Softaculous


Topic : Multiple PHP-Versions


1

Posted By: codesight on October 25, 2013, 6:31 pm
Hello,

I assumed to be able to have all php-Versions installed in Webuzo, leave 5.3. set as default and have the option tu select the php-version on the app-install-page of the web packages (joomla f. e. or something else)

So I installed PHP 5.4 and ran into the problem of webuzo constantly losing the login-session.
In Detail:
- I click on install in php 5.4-section,
- Installation runs quite smooth with no errors
- next, I click in Home which stll works,
- after that I click on a webapp and webuzo asks me to login
- so I log in again, click on a webapp and webuzo asks me to login, again

Same in Control Panel. I log in, click on any settings section and get asked to log in again.

So if the php-package is broken this shouldn't be that bad cause I assume this is fixable, but I wonder if it is possible to have multiple php-Versions installed, generally? If so how die I select the php-Version for any WebApp-Package individually? Do I have to reset the default php-version every time? This would be really bad.

-----------------------
Don't you dare to ask for root details!

Posted By: valley on October 26, 2013, 3:49 am | Post: 1
Hi,

Sir you can use the following guide to install system apps:
http://www.webuzo.com/wiki/Install_System_Apps

You can use the following guide to switch php versions:
http://webuzo.com/wiki/System_Utilities

Quote

Same in Control Panel. I log in, click on any settings section and get asked to log in again.


Try restarting the Webuzo service:
Code
Root > service webuzo restart


Quote

If so how die I select the php-Version for any WebApp-Package individually? Do I have to reset the default php-version every time?



Once the default is selected it is applicable for all of the applications.

-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: codesight on October 26, 2013, 9:05 am | Post: 2
Quote From : valley October 26, 2013, 3:49 am
Hi,
Try restarting the Webuzo service:
Code
Root > service webuzo restart



OK, seems to work butthe restart produces errors:
Code
Stopping nginx: Done...
Stopping php-fpm: /usr/local/emps/bin/fpmctl: line 46: [: 1480
2287: integer expression expected
php-fpm is stopped
Starting nginx: Done...
Starting php-fpm: /usr/local/emps/bin/fpmctl: line 24: [: 1480
2287: integer expression expected
php-fpm already running...


Quote

Once the default is selected it is applicable for all of the applications.


Doesn't make sense to me. Why have the option to have several php-version installed simultanious, but use only one overall?
F. e. if I install several webapps with php 5.3 - how do I know they will work with php 5.4?

-----------------------
Don't you dare to ask for root details!

Posted By: codesight on October 26, 2013, 9:25 am | Post: 3
Now there is exactly the problem i've spoken of. vtiger f.e. doesn't work under php 5.4 and 5.5:

Code
Deprecated: Assigning the return value of new by reference is deprecated in /home/neomis/public_html/support/adodb/adodb.inc.php on line 893

Deprecated: Assigning the return value of new by reference is deprecated in /home/neomis/public_html/support/adodb/adodb.inc.php on line 1919

Deprecated: Assigning the return value of new by reference is deprecated in /home/neomis/public_html/support/adodb/adodb.inc.php on line 1991

Deprecated: Assigning the return value of new by reference is deprecated in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 373

Deprecated: Assigning the return value of new by reference is deprecated in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 385

Strict Standards: Declaration of dbTable::create() should be compatible with dbObject::create() in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 605

Strict Standards: Declaration of dbIndex::create() should be compatible with dbObject::create() in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 769

Strict Standards: Declaration of dbData::create() should be compatible with dbObject::create() in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 956

Strict Standards: Declaration of dbQuerySet::create() should be compatible with dbObject::create() in /home/neomis/public_html/support/adodb/adodb-xmlschema.inc.php on line 1207

Strict Standards: Only variables should be assigned by reference in /home/neomis/public_html/support/include/database/PearDatabase.php on line 20

Strict Standards: Only variables should be assigned by reference in /home/neomis/public_html/support/include/database/PearDatabase.php on line 21

Strict Standards: Only variables should be assigned by reference in /home/neomis/public_html/support/include/database/PearDatabase.php on line 937

Strict Standards: Only variables should be assigned by reference in /home/neomis/public_html/support/include/database/PearDatabase.php on line 225

Fatal error: Cannot re-assign auto-global variable _FILES in /home/neomis/public_html/support/include/utils/CommonUtils.php on line 1395


So the whole feature seems to be useless. Bad thing.

-----------------------
Don't you dare to ask for root details!

Posted By: valley on October 26, 2013, 9:55 am | Post: 4
Quote

OK, seems to work butthe restart produces errors:

Please execute the following commands:
Code

Root > killall -9 php-fpm
Root > service webuzo restart


OR

Code

Root > service perl-fcgi stop
Root > service webuzo restart


This issue is already fixed and will be available in the next version of Webuzo

Quote

Doesn't make sense to me. Why have the option to have several php-version installed simultanious, but use only one overall?


Sir at the moment we have made a provision to switch among PHP versions common to all the web applications.
You can manually configure the .htaccess by yourself in your directories to make use of the particular php

Apache configuration files are located at :
Code
/usr/local/apps/apache/etc/


Quote

F. e. if I install several webapps with php 5.3 - how do I know they will work with php 5.4?

Check for  the script requirements or Use the above mentioned method.

Quote

So the whole feature seems to be useless. Bad thing

We have noted this requirement and have added this to our TO-DO list.


-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: codesight on October 26, 2013, 10:04 am | Post: 5
[quote poster=valley date=1382781324][quote]
Sir at the moment we have made a provision to switch among PHP versions common to all the web applications.
You can manually configure the .htaccess by yourself in your directories to make use of the particular php

Apache configuration files are located at :
Code
/usr/local/apps/apache/etc/

[/quote]

That would be a workaround at least. Hadn't thought about ist. Thanks :)

-----------------------
Don't you dare to ask for root details!

Posted By: valley on October 26, 2013, 10:10 am | Post: 6
Quote

That would be a workaround at least. Hadn't thought about ist. Thanks :)


Please do update about your progress over the same.
Might be useful to others as well :)

-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: codesight on November 14, 2014, 1:05 pm | Post: 7
Hello,

I have a little bit time to look into this again and it seems it won't work in .htaccess either.

The thing is, you can put something like
<IfModule mod_suphp.c>
suPHP_ConfigPath /usr/local/apps/php54
</IfModule>
in the .htaccess-file and it will change _SERVER["PHPRC"] to    /usr/local/apps/php54.

But php 5.3 is still used because adding a handler like
AddHandler application/x-httpd-php54 .php
will brake the page and result in an error 500.

I assume this is because /usr/local/apps/apache/etc/conf.d/suphp.conf says to load suphp-module from /usr/local/apps/php53/lib/mod_suphp.so.
Loading a different module would affect all websites, of course. So this wouldn't be an option.

Does anyone have an idea to run a different php-version on a single website?

-----------------------
Don't you dare to ask for root details!

Posted By: codesight on November 14, 2014, 2:09 pm | Post: 8
I'm still missing the "edit"-button.

Anyways,

<IfModule mod_suphp.c>
suPHP_ConfigPath /usr/local/apps/php54/etc
</IfModule>

seems to do the trick.
Loaded Configuration File says    /usr/local/apps/php54/etc/php.ini

-----------------------
Don't you dare to ask for root details!

Posted By: codesight on November 14, 2014, 2:33 pm | Post: 9
Argh.... PHPInfo says that the right php.ini is loaded, but extensions are not!
Also php53_log is still being used. What's the deal here!?


-----------------------
Don't you dare to ask for root details!

Posted By: valley on November 19, 2014, 5:40 am | Post: 10
Could you post the complete contents of the .htaccess file ?

-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: codesight on November 19, 2014, 2:27 pm | Post: 11
Quote From : valley November 19, 2014, 5:40 am
Could you post the complete contents of the .htaccess file ?


PHP Code

 <IfModule mod_suphp.c>
suPHP_ConfigPath /usr/local/apps/php54/etc
</IfModule>

<
IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond 
%{HTTPSoff
RewriteRule 
(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

RewriteEngine On
RewriteBase 
/
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -[OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule 
^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $[L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $[L]
RewriteRule index.php [L



-----------------------
Don't you dare to ask for root details!

Posted By: codesight on November 28, 2014, 6:24 am | Post: 12
Is there any progress here?

-----------------------
Don't you dare to ask for root details!

Posted By: valley on November 28, 2014, 6:39 am | Post: 13
Did you check the logs after the changes ?

-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: codesight on November 28, 2014, 6:46 am | Post: 14
Sure. Suphp53.log is still used as if nothing changed. Which apperently not did, refering to phpinfo.

-----------------------
Don't you dare to ask for root details!

Posted By: codesight on December 4, 2014, 5:13 pm | Post: 15
Hi Valley,

any progress here?

-----------------------
Don't you dare to ask for root details!

Posted By: valley on December 5, 2014, 5:54 am | Post: 16
Sir I shall replicate this on my test server and provide a solution ASAP.

Apology for the delay and trouble.

-----------------------
Webuzo : Single User Control Panel
Join Webuzo :
Facebook
Twitter


Posted By: jcsv75 on September 17, 2018, 6:09 am | Post: 17
This is an old thread but I am having similar issues. I am running PHP 7.2 on my webuzo VPS. No issues there, however there is one Wordpress plugin that still runs on PHP 5.6.

How can I modify the .htaccess so that PHP 5.6 is used only for this specific WordPress install?

Thanks a lot!

Posted By: webuzo_manager on September 17, 2018, 7:00 am | Post: 18
Hi jcsv75,

Currently, that's not possible through .htaccess in Webuzo but we will be providing a solution in future releases to allow for this capability.

Posted By: trondandre on October 21, 2018, 6:36 am | Post: 19
Quote From : webuzo_manager September 17, 2018, 7:00 am
Hi jcsv75,

Currently, that's not possible through .htaccess in Webuzo but we will be providing a solution in future releases to allow for this capability.



Hi, when can we expect this provide you think?

Regard
Trond André

Posted By: Dhanya on October 27, 2018, 12:17 pm | Post: 20
Hi trondandre,

At the moment, we don't have option to enable multiple PHP versions on different domains. But we will try to include it in future versions.

Posted By: trondandre on October 28, 2018, 6:09 am | Post: 21
Yes i can se that but i meen: when can we espect this in the future :)

Posted By: Dhanya on October 29, 2018, 6:29 am | Post: 22
Hi trondandre,

Because of some issues we couldn't add this in past, but we will try our best to add in later versions.

Thank you for your patience.

Posted By: trondandre on May 20, 2019, 8:16 am | Post: 23
Is this possible soon?

Regards
Trond André

Posted By: vbarlakoski on October 29, 2019, 12:45 pm | Post: 24
WOW, 5 years later, no solution provided. Is it gonna happen, at all?

Posted By: daniel.bair on November 22, 2019, 12:29 am | Post: 25
This is my solution:
First edit /usr/local/apps/php56/bin/fpmctl56
Code
sudo vi /usr/local/apps/php56/bin/fpmctl56
And modify it like this:
Code
pidfile=/var/run/php-fpm56.pid
OPTIONS="-R --pid /var/run/php-fpm56.pid --fpm-config /usr/local/apps/php56/etc/php-fpm.conf -c /usr/local/apps/php56/etc/php.ini"
After that run:
Code
sudo /usr/local/apps/php56/bin/fpmctl56 start

Then edit your .htaccess and add this:
Code
# Use PHP5.6 as default
<FilesMatch \.php$>
        <If "-f %{REQUEST_FILENAME}">
                SetHandler "proxy:unix:/usr/local/apps/php56/var/php56_9000.sock|fcgi://localhost"     
        </If>
</FilesMatch>

This works for me, and it keeps going with updates to Apache (but of course will not with updates to PHP 5.6 - you will have to make the /usr/local/apps/php56/bin/fpmctl56 edits again then).
Reason: I had set the default PHP to 7.2 due to security reasons, but one subdomain needed PHP 5.6 to work.

Posted By: drapet on July 19, 2020, 10:44 am | Post: 26
Quote From : daniel.bair November 22, 2019, 12:29 am
This is my solution:
First edit /usr/local/apps/php56/bin/fpmctl56
Code
sudo vi /usr/local/apps/php56/bin/fpmctl56
And modify it like this:
Code
pidfile=/var/run/php-fpm56.pid
OPTIONS="-R --pid /var/run/php-fpm56.pid --fpm-config /usr/local/apps/php56/etc/php-fpm.conf -c /usr/local/apps/php56/etc/php.ini"
After that run:
Code
sudo /usr/local/apps/php56/bin/fpmctl56 start

Then edit your .htaccess and add this:
Code
# Use PHP5.6 as default
<FilesMatch \.php$>
        <If "-f %{REQUEST_FILENAME}">
                SetHandler "proxy:unix:/usr/local/apps/php56/var/php56_9000.sock|fcgi://localhost"     
        </If>
</FilesMatch>

This works for me, and it keeps going with updates to Apache (but of course will not with updates to PHP 5.6 - you will have to make the /usr/local/apps/php56/bin/fpmctl56 edits again then).
Reason: I had set the default PHP to 7.2 due to security reasons, but one subdomain needed PHP 5.6 to work.


when I start
sudo / usr / local / apps / php56 / bin / fpmctl56 start
I get an error:

Starting php-fpm: [19-Jul-2020 05:04:38] ERROR: An another FPM instance seems to already listen on /usr/local/apps/php56/var/php56_9000.sock
[19-Jul-2020 05:04:38] ERROR: FPM initialization failed
[root @ vps ~] # Starting php-fpm: [19-Jul-2020 05:04:38] ERROR: An other FPM instance seems to already listen on /usr/local/apps/php56/var/php56_9000.sock

Any idea.

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.