Multiple PHP versions on CentOS7 with virtualmin

3 posts / 0 new
Last post
#1 Sat, 08/04/2018 - 13:24
amrod

Multiple PHP versions on CentOS7 with virtualmin

I installed both php5.6 and php7.1 and I can see them on "PHP Versions" in Server Configuration. In "Website Options" I selected "CGI wrapper (run as virtual server owner) "

Then when I select php7, It adds the following Directives to httpd.conf

RemoveHandler .php

RemoveHandler .php5

RemoveHandler .php7.1

php_admin_value engine Off

Then website becomes inaccessible, The requested URL /cgi-bin/php5.cgi/index.php was not found on this server.

When I comment out these lines I can access to the website but I can not use PHP 7.1

Any ideas?

Tue, 08/07/2018 - 08:50
JoeDoe

Hi,
I've encountered very similar issue.
The requested URL /cgi-bin/php5.cgi/index.php was not found on this server.
I'm running multiple PHP versions on CentOS 7.
I had some issues with switching from mod_php to FastCGI.
I found that only mod_php was working for me.
Up-on switching to FastCGI i've had the same issue "The requested URL /cgi-bin/php5.cgi/index.php was not found on this server."
What i did was to fix this is remove;

SuExecGroup


From httpd.conf
Could you verify if this fixes you issue?

Thanks.

~ Joe Doe

Wed, 08/08/2018 - 13:47
amrod

Finally I fixed the problem. If anyone has the same problem the fix is;

There was missing configuration lines for the virtualhost in the http.conf, I added the following lines;

ScriptAlias /cgi-bin/ /home/xxx.net/cgi-bin/

<Directory /home/xxx.net/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>

2 nd change I did; suexec rootdoc.

suexec -V
-D AP_DOC_ROOT="/var/www"

so I delete www and create symlink to /home

rm -fr /var/www
ln -s /home /var/www

Now both php versions work good.

Topic locked