I hope you guys can help me a bit here with setting up PHP 7 on Debian 8.
I’ve installed PHP7 on my Debian 8 using the method described here: https://www.colinodell.com/blog/2015-12/installing-php-7-0-0
After that, I went into virtualmin and changed php version on a virtual server to 7.0.5 under server configuration -> php versions (both php 5.6.17 and 7.0.5 were listed).
From server configuration -> website options I have php enabled through fcgi and under php information I can see a lot of modules for PHP 7.0. I also did a recheck of the virtualmin configuration and it told me that: The following PHP versions are available : 5.6.17 (/usr/bin/php5-cgi), 7.0.5 (/usr/bin/php7.0).
So it seems fine… right?
Problem is, I’m testing with a simple php page with only this code: <?php phpinfo(); ?>
But I just get a Internal Server Error displayed. In my log I see this error:
[Fri Apr 01 01:26:13.339029 2016] [fcgid:warn] [pid 86577] (104)Connection reset by peer: [client 10.0.1.105:59629] mod_fcgid: error reading data from FastCGI server
[Fri Apr 01 01:26:13.339073 2016] [core:error] [pid 86577] [client 10.0.1.105:59629] End of script output before headers: index.php
What am I missing to get php 7 running?
When u want Run your Website with PHP 7.0 then maybe is this your Solution:
Go to your Domain-Directory
Then remove a Bit:
chattr -i php7.0.fcgi
and Edit the fcgi-File with nano or vi
Edit the follow line:
to the follow:
Write and Exit, then take again chattr bit:
chattr +i php7.0.fcgi
Restart Apache and your Web will Run with PHP 7.0.
service apache2 restart
FCGID doesn’t always produce great errors.
What you may want to try, if you are seeing generic errors like that one, is to temporarily switch the PHP Execution Mode to “CGI”.
After doing that – access your website again, and then take a look at your log files. After doing that, what error(s) do you see?
The Problem what dyvel have and i had is, that virtualmin itself not support PHP 7 yet.
But when i want use PHP 7.0, then i can edit the php7.0-fcgi (see my Post) and normaly use PHP 5.6 in a ohter directory, if needed.
If php7.1-cgi is not installed when you check your configuration, virtualmin generates invalid fcgi scripts. There appears no way to force Virtualmin to fix them -
deleting them and checking configuration does not help. I have found two ways:
Uninstall PHP 7.1 and check config in web UI, reinstall PHP 7.1 and check config in web UI
Make a good version of the file and copy everywhere with something like:
for d in $(locate php7.1.fcgi); do chattr -i $d; cp --no-preserve=mode,ownership,timestamps php7.1.fcgi $d; chattr +1 $d; done