LSWS 4.1 does not obey Plesk 10.2 PHP clause

priestjim

Well-Known Member
#1
Hi all,

It seems that LSWS 4.1 does not honor the PHP CGI clause that Plesk 10.2 uses to enable PHP support on a domain:

Code:
<Files ~ (\.php)>
    SetHandler None
    AddHandler php-script .php
    Options +ExecCGI
    allow from all
</Files>
and thus I get:

Code:
Forbidden: PHP engine is disable.
/etc/httpd/conf.d/php5.conf has:

Code:
<IfModule prefork.c>
    LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
    LoadModule php5_module modules/libphp5-zts.so
</IfModule>

AddHandler php5-script .php .php5 .phtml
AddType text/html .php .php5 .phtml

DirectoryIndex index.php index.php5
 

priestjim

Well-Known Member
#3
Self-reply:

Parallels disables by default the mod_php engine through the dynamically generate server configuration file in /usr/local/psa/admin/conf/generated and when needed, it activates the PHP fastcgi module, which does not read the php_* flags and hence works. LSWS reads them though and complains that the PHP engine is disabled.

Temporary workaround: Create a file called zz009_php_engine.conf in /etc/httpd/conf.d and put this inside:

Code:
<Directory "/var/www/vhosts">
        <IfModule sapi_apache2.c>
                php_admin_flag engine on
        </IfModule>

        <IfModule mod_php5.c>
                php_admin_flag engine on
        </IfModule>
</Directory>
 
#6
Self-reply:

Parallels disables by default the mod_php engine through the dynamically generate server configuration file in /usr/local/psa/admin/conf/generated and when needed, it activates the PHP fastcgi module, which does not read the php_* flags and hence works. LSWS reads them though and complains that the PHP engine is disabled.

Temporary workaround: Create a file called zz009_php_engine.conf in /etc/httpd/conf.d and put this inside:

Code:
<Directory "/var/www/vhosts">
        <IfModule sapi_apache2.c>
                php_admin_flag engine on
        </IfModule>

        <IfModule mod_php5.c>
                php_admin_flag engine on
        </IfModule>
</Directory>
I guess these lines should be added to /etc/httpd/conf.d/zz012_php_engine.conf instead, to make it load after Plesk's configuration files.
 
Top