My "PHP version per directory" config not working anymore after todays alt-php update
Forum
  1. Forums
  2. General
  3. General Discussion
  1. Marcin Kedzia
  2. Monday, 21 March 2016
  3.  Subscribe via email
Hello,
after todays php selector/alt-php upd ate my custom \"php version per directory\" config is not working anymore.
As I can see, you removed php.d symlink to /etc/cl.php.d/alt-phpXX and now you replaced it with regular php.d directory containing default.ini file in it.
So now for example if I place line in .htaccess:
AddType application/x-httpd-php70 .php
my php version is switched to 7.0.4 in my directory but modules configured in cPanel PHP Selector are not configured anymore and not visible in phpinfo();.
Instead of php.d symlink to /etc/cl.php.d/alt-phpXX you created link directory with cons symlink in it pointing to /opt/alt/phpXX/etc/php.d instead of pointing to /etc/cl.php.d/alt-phpXX like before, which breaks my custom php version se t per directory basis.

It was your intended action or you did this by mistake or any other reason?

FYI I have LiteSpeed Web Server with CageFS and as a Command config value in lsws for PHP 7 for example I\'m using:
/opt/alt/php70/usr/bin/lsphp

and this way me and my customers was able to switch PHP versions per directory basis since many months up until today.
Rate this post:
  1. 21.03.2016 17:03:46
  2. # 1
Marcin Kedzia Accepted Answer
Posts: 7
Joined: 18.04.2012
0
Votes
Undo
UPDATE:
As per suggestion in the ticket I removed php.d directories and changed them to php.d symlinks pointing to /etc/cl.php.d/alt-phpXX directories.
Now everything is working like before but only until next alt-php/selector upgrade. Can you do this permanent for users not using EaseApache and MultiPHP functionality? or I will have to manually do this every time after alt-php update?
  1. 21.03.2016 18:03:18
  2. # 2
Richard Hordern Accepted Answer
Posts: 219
Joined: 19.03.2011
0
Votes
Undo
Same problem here, is this a bug ? Do you have a more reliable / long term solution to solve this issue ?
  1. 22.03.2016 06:03:56
  2. # 3
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
I have just talked to our developers and unfortunately there is no \'nice\' solution for this as PHP per directory is not officially supported by CloudLinux .

The solution to remove php.d and made symlinks is right, and yes the same should be done after next alt-php update.
  1. 22.03.2016 11:03:16
  2. # 4
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
We are considering this situation right now to provide a right and working solution for you. I will update this thread.
  1. 23.03.2016 11:03:39
  2. # 5
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
 We decided to cover all possible situations and in future going to implement following functionality - there will be a config option where you choose how those symlinks will be created:
- default, where users will get same 'default' modules for enabled and disabled CageFS. So alt-php could be used without cagefs and without PHP-Selector.
or
- custom, where you will get modules chosen from PHP-Selector for PHP versions when CageFS enabled. However with disabled CageFS you will get default extensions.

After implementing PHP version per directory you will set th way alt-php handle symlinks for example in /etc/cl.selector/symlinks.rules file .This way PHP per directory will keep working after updates, etc.

Let me know what you think about this.
  1. 23.03.2016 12:03:28
  2. # 6
kernow Accepted Answer
Posts: 72
Joined: 06.08.2010
0
Votes
Undo
Were happy to go with:
[color=#FF0000]default, where users will get same \'default\' modules for enabled and disabled CageFS. So alt-php could be used without cagefs and without PHP-Selector[/color]
  1. 23.03.2016 13:03:16
  2. # 7
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
That is how it works now... That\'s why it breaks php per directory.
Going to make it selectable so it will work properly for standard and for php per directories also.
  1. 23.03.2016 16:03:26
  2. # 8
Marcin Kedzia Accepted Answer
Posts: 7
Joined: 18.04.2012
0
Votes
Undo
We decided to cover all possible situations and in future going to implement following functionality - there will be a config option where you choose how those symlinks will be created:
- default, where users will get same \'default\' modules for enabled and disabled CageFS. So alt-php could be used without cagefs and without PHP-Selector.
or
- custom, where you will get modules chosen from PHP-Selector for PHP versions when CageFS enabled. However with disabled CageFS you will get default extensions.

After implementing PHP version per directory you will set th way alt-php handle symlinks for example in /etc/cl.selector/symlinks.rules file .This way PHP per directory will keep working after updates, etc.

Let me know what you think about this.
Sounds good :)
  1. 18.04.2016 05:04:37
  2. # 9
Dalibor Kouril Accepted Answer
Posts: 1
Joined: 24.11.2015
0
Votes
Undo
Same problem here. Is this script correct way to fix the original state?
#!/bin/bash

for VERSION in `ls /opt/alt|grep "php[0-9]"`
do
if [ -d "/opt/alt/$VERSION/etc/php.d" ]; then
rm -rf "/opt/alt/$VERSION/etc/php.d"
ln - "/opt/alt/$VERSION/etc/php.d" "/etc/cl.php.d/alt-$VERSION"
echo "$VERSION - OK"
fi
done
  1. 03.05.2016 07:05:45
  2. # 10
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.