PHP Selector not working right

anti-ts

Verified User
Joined
Jan 25, 2014
Messages
42
Hi...

Long time DA user, I'm building a new server and decided to go with cb2.
Also I decided to try cloudlinux together.

PHP Selector is not working right!
Currently I'm running with the following php options:
php1_release=5.5
php2_release=5.4
php1_mode=fastcgi
php2_mode=suphp

The PHP selector is available in user panel, but please have a look at the screenshot (what I'm getting).

I tried several things. Among them:
./build rewrite_confs

and to disable and enable the plugin.

I'm also using the cagefs. I deactived cagefs but php selector problem is the same.

File /usr/local/directadmin/data/skins/enhanced/user/modify_domain.html end here:
|*endif|

|*if HAS_PHP_SELECTOR="yes"|
<br>
|PHP_SELECTOR_TABLE|
|*endif|

|HTM_USER_BOTTOM|


Thank you!
 

Attachments

  • php-selector-problem.png
    php-selector-problem.png
    10.1 KB · Views: 880
You seem to be using CloudLinux PHP selector. For it to work CageFS must be enabled and users should be in it. Please also check /etc/cl.selector/native.conf, it should look like the following in your case:
Code:
php.ini=/usr/local/php55/lib/php.ini
php=/usr/local/php55/bin/php-cgi55
php-fpm=/usr/local/sbin/php-fpm
php-cli=/usr/local/bin/php
 
Thank you smtalk ...

My /etc/cl.selector/native.conf has the values you've sent, with the addition of one more line:
Code:
lsphp=/usr/local/bin/lsphp

Here are also 2 useful:

Code:
# /usr/bin/cl-selector --summary=php
WARN:Alternatives config not found. Using native version
native e d

# cat /etc/cl.selector/defaults.cfg
[versions]
php=native

I haven't installed:
Code:
# yum groupinstall alt-php

If I install the alt-php will the custombuild php versions and mode options (in options.conf) be ignored and packaged versions will be in use only?
I mean the php1_release, php2_release, php1_mode, php2_mode values.

How do I say the mode in that case?


One more thing: I installed cb2 and cl together. How is the default PHP selector of DA looks like without CL?


Thank you!
 
Update: I see that with CloudLinux there is no way now to choose different php handler for different php versions.

Can I use cb 2 default PHP selector and also have use the CloudLinux?

I want to use features like the LVE, cagedfs, mysql gov etc. but also be able to choose PHP versions + handlers.


Thank you!
 
Yes, you can use DA selector. However, if you do "yum groupinstall alt-php", your php1_release would still be the default one, and only if you change version in CloudLinux PHP selector, it would have the effect.
 
Yes, you can use DA selector.

How can I use the DA selector?

However, if you do "yum groupinstall alt-php", your php1_release would still be the default one, and only if you change version in CloudLinux PHP selector, it would have the effect.

I know, but I want different handlers.
Actually I need php55 fastcgi (most sites) and php53 suphp (some sites for compatibility).

(I'm setting this new server to abandon an older one)

Thank you!
 
You should see the DA PHP selector when you're modifying a domain. I'm attaching you a screenshot of it.
 

Attachments

  • images.jpg
    images.jpg
    6.6 KB · Views: 681
Thank you for your help.

I did set the php 5.3 (suphp) for one domain.
As seen in the screenshot here.


Unfortunately, PHP 5.3 (suPHP) is not working.
:confused:

The browser returns the php source code (not executing the code)....

- related error log in /var/log/httpd/domains is clean (it is a 200 resonse).
- httpd/suexec log is clean.

Any ideas maybe?

Thank you.
 
Thank you for your help.

I did set the php 5.3 (suphp) for one domain.
As seen in the screenshot here.

Thank you.

(forgot the screenshot in previous post - here it is)
 

Attachments

  • php-selector-da-suphp-53.png
    php-selector-da-suphp-53.png
    6.5 KB · Views: 373
Obviously (because source code php was served to http requests), no handler was set in my setup.

To make it work I edited "/usr/local/directadmin/data/users/X/httpd.conf".

Inside the VirtualHost > Directory directive, I had to add:
Code:
AddHandler x-httpd-php53 .php

and suphp 5.3 is working.

Is this a bug? It seems like a bug to me.

(By the way, it seems strange to me that inside "/usr/local/directadmin/data/users/X/httpd.conf" you can see a Directory and after that a VirtualHost > Directory definition. I would expect only the VirtualHost definition.)


When building the configuration files again:
Code:
./build rewrite_confs
the file "/etc/httpd/conf/extra/httpd-suphp.conf" is generated, the following handler is added:
Code:
AddHandler x-httpd-php53 .php53

which is correct to have php53 files being served by PHP 5.2 (suPHP).

But for any domains that we need to use PHP 5.3 as the primary php, we need:
Code:
AddHandler x-httpd-php53 .php
and this is not added somewhere.

Please I would appreciate any help on this to have selectable php in DA interface, without the need of editing and hacks after re-building.


Thank you....
 
I decided to use php53 (fastcgi) + php55 (fastcgi) and everything works fine this way.
 
Same issue (different php mode) on new install directadmin.

options.conf

#PHP settings.
#Default version of PHP is always php1_release. Possible values for php1/php2_release: 5.3, 5.4, 5.5, no. php1/php2_mode: mod_php, fastcgi, php-fpm or suphp)
php1_release=5.5
php2_release=5.3
php1_mode=mod_php
php2_mode=suphp
htscanner=yes
php_ini=no
php_timezone=CET
#Possible values - production or development
php_ini_type=production
ioncube=yes
x-mail-header=yes
zend=yes
..
.


When switching from 5.5 to php 5.3 no change in php version for user.
Server: Centos 6.5 (64 bit)
Directadmin: 1.45
 
Last edited:
smtalk this feature needs some work I think, I havent done anything particurly out of the ordinary on this cloudlinux server, eg. used custombuild 2.0 and standard DA httpd templates yet, I have the same issue as the OP.

I examined the /etc/cl.selector/native.conf file and it displays this.

Code:
lsphp=/usr/local/bin/lsphp
php.ini=/usr/local/etc/php53/cgi/php.ini
php=/usr/local/php5/bin/php-cgi
php-fpm=/usr/local/sbin/php-fpm
php-cli=/usr/local/bin/php

out of all those listed binaries only the bottom one php-cli exists on the server.

if its relevant I am not using cloudlinux php packages, I installed via custombuild.

now the worrying thing is it seems there is this new option in the gui that unwary users may mess with that is broken and may crash httpd if it tries to apply a bad setting, is there no way to disable this function in the DA gui?
 
Back
Top