Php 7 and php 5.6 running but php 5.6 doesn´t load

8 posts / 0 new
Last post
#1 Fri, 07/29/2016 - 06:05
cinterpro
cinterpro's picture

Php 7 and php 5.6 running but php 5.6 doesn´t load

Dear all,

Yesterday i did a fresh install of ubuntu 16.x with virtualmin. Everythings seems to run with no problem. Than I installed php php5.6 and created 2 (test) domains. One domain for normal test use (joomla, wordpress, suitecrm, etc) which seems to work and another domain where I sselected both for the /root dir the php version 5.6.24 and i selected this version for the folders /soporte / wiki, etc.

but when I go about to install the programs it throws a 500 error and when doing php -v it says: PHP 7.0.9-1+deb.sury.org~xenial+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.9-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies and in the error_log for this domains the last lines say:

[Fri Jul 29 12:27:54.766121 2016] [fcgid:warn] [pid 8051] (104)Connection reset by peer: [client 192.168.1.133:56533] mod_fcgid: error reading data from FastCGI server
[Fri Jul 29 12:27:54.766220 2016] [core:error] [pid 8051] [client 192.168.1.133:56533] End of script output before headers: index.php
[Fri Jul 29 12:32:10.201047 2016] [fcgid:warn] [pid 8052] (104)Connection reset by peer: [client 192.168.1.133:56595] mod_fcgid: error reading data from FastCGI server
[Fri Jul 29 12:32:10.201151 2016] [core:error] [pid 8052] [client 192.168.1.133:56595] End of script output before headers: php.php
[Fri Jul 29 12:54:07.052998 2016] [core:error] [pid 2943] [client 192.168.1.133:56847] End of script output before headers: index.php
[Fri Jul 29 13:03:26.659413 2016] [fcgid:warn] [pid 2941] (104)Connection reset by peer: [client 192.168.1.133:56948] mod_fcgid: error reading data from FastCGI server

Can anyone help me out here as why it does not load the php 5.6.24 version. when doing locate php.ini i get this:

/etc/php/5.6/apache2/php.ini
/etc/php/5.6/cli/php.ini
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cgi/php.ini
/etc/php/7.0/cli/php.ini
/home/localhost56/etc/php.ini
/home/localhost56/etc/php7.0/php.ini
/home/localhostci/etc/php.ini
/home/localhostci/etc/php7.0/php.ini
/home/localhostci/public_html/phpmyadmin/test/travis.php.ini
/usr/lib/php/5.6/php.ini-development
/usr/lib/php/5.6/php.ini-production
/usr/lib/php/5.6/php.ini-production.cli
/usr/lib/php/7.0/php.ini-development
/usr/lib/php/7.0/php.ini-production
/usr/lib/php/7.0/php.ini-production.cli

I guess this error is caused by the FastCGI , can this be correct?

can not even run the small php.php script with the contens:

<?php
 phpinfo();
?>

. It gives me the same error. Can anyone help me out here, please? Hoping to hear from you, Regards, Paco

Pd. Tried this solution: https://www.virtualmin.com/node/25539 currenlty for the domain with php v 5.6.24 i have this: CGI wrapper (run as virtual server owner) FCGId (run as virtual server owner) changed it and reloaded and than changed it back to FCGId, but again, but no luck. Please see this

Tue, 08/02/2016 - 04:28
cinterpro
cinterpro's picture

Hello. As mentioned in my initial post i made yesterday a fresh install of Ubuntu 16.x and created 2 domains:

  • localhostci.com (to run scripts, joomla, helpdesk, etc) with php 7.x which works fine
  • and this domain localhost56.com (to run scripts, joomla, helpdesk, etc) with php 5.6

and selecting for the domain localhost56.com only php 5.6 i get this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
  • [Tue Aug 02 10:10:12.335586 2016] [fcgid:warn] [pid 32467] (104)Connection reset by peer: [client 192.168.1.133:55908] mod_fcgid: error reading data from FastCGI server
  • [Tue Aug 02 10:10:12.335683 2016] [core:error] [pid 32467] [client 192.168.1.133:55908] End of script output before headers: index.php

i saw in this forum many posts regarding this issue but no luck changing it from FCGId to CGI wrapper.
And I have no clue how to be able to fix this.
Spent already some time with this and I am hoping to be able to resolve this issue
Can anyone help me point in the right direction, please? Regards,
Paco

Tue, 08/02/2016 - 07:09
unborn
unborn's picture

is there any reason to must have unstable php7?

Configuring/troubleshooting Debian servers is always great fun

Tue, 08/02/2016 - 10:31
andreychek

Howdy,

What error(s) do you see in the logs when using CGI as the PHP Execution Mode?

Also, if you go into System Settings -> Re-Check Config, does it detect both PHP versions there?

-Eric

Wed, 08/03/2016 - 03:29
cinterpro
cinterpro's picture

Dear Eric. Many thanks for your reply, please not the answers to your questions. 1. (error)log Changed in "serverConfiguration -> Websiteoptions" from FCGId (run as virtual server owner) to CGI wrapper (run as virtual server owner) with Maximum PHP script run time: 420 seconds. Strange, I select CGI as PHP Execution Mode and is says:

Changing PHP execution mode to CGI wrapper (run as virtual server owner) ..
.. done
<ul>
<li>Changing maximum PHP script run time to 420 seconds .... done</li>
<li>Applying web server configuration ..</li>
.. done</ul>

But when returning to "serverConfiguration -> Websiteoptions" it is NOT selected ( i don´t see the dot marked the option "CGI wrapper (run as virtual server owner)"
the (error)log says: [Wed Aug 03 10:12:45.020747 2016] [autoindex:error] [pid 8350] [client 192.168.1.133:65076] AH01276: Cannot serve directory /home/localhost56/public_html/proyecto/: No matching DirectoryIndex (index.html,index.htm,index.php,index.php4,index.php5) found, and server-generated directory index forbidden by Options directive 2. When going here: System Settings -> Re-Check Config, does it detect both PHP versions there? It says:

The following PHP versions are available : 5.6.24 (/usr/bin/php5.6), 7.0.8 (/usr/bin/php-cgi7.0)
<br>Webalizer is installed.
<br>Apache is configured to host SSL websites.
<br>MySQL is installed and running.
<br>ProFTPD is installed.
<br>Logrotate is installed.
<br>Plugin AWstats reporting is installed OK.
<br>Plugin Protected web directories is installed OK.
<br>Using network interface enp5s0 for virtual IPs.
<br>Default IPv4 address for virtual servers is 192.168.1.21.
<br>Default IP address is set to 192.168.1.21, but the detected external address is actually 37.11.114.155. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page.
<br>Both user and group quotas are enabled for home and email directories.
<br>All commands needed to create and restore backups are installed.
<br>The selected package management and update systems are installed OK.
<br>.. your system is ready for use by Virtualmin.

Can you help me resolve this issue so I can execute scripts using php5.6.24 or php7.x, please?
Hoping to hear from you
Regards,
Paco

Wed, 08/03/2016 - 09:01
cinterpro
cinterpro's picture

Dear nithyajacob. Many thanks for replying. I did a fresh install on a box (CPU-I5) 8GB memory using http://releases.ubuntu.com/16.04/. I think you are right that php 5.6 is working but doesn´t load. I think in the virtualmin enviroment it should work, having php 7.x which comes with Ubuntu 16. and alongside php 5.6. No? Never the less, this article gave me some insight, that it might work. please read thiis link:Please read this article when using this command : sudo update-alternatives --config php it lets me change the php version Manually. but there must be an easier way, no? As you can see, i am totally lost. When I get back in 4 hours, will do again a fresh install (Ubuntu 16.x + php5.6) and will look further.

Getting desperate :-( Regards, Paco

Tue, 11/01/2016 - 11:11
orsomannaro

Same problem here...

Have you found a solution?

TIA

Wed, 08/23/2017 - 16:28 (Reply to #7)
mollat

This thread is somewhat older now. However - I just had the same problem (Ubuntu 16.04 with ppa:ondrej/php) and a simple solution:

Don't install "php5.6", but "php-cgi5.6" instead... ;)

Topic locked