updating System PHP5.5.9 to php7.0.6, problems

Discussion in 'ISPConfig 3 Priority Support' started by chico11mbit, May 11, 2016.

  1. chico11mbit

    chico11mbit Member

    Hi,
    i think i made a mistake by installing PHP7.0.6 as system php to replace to php5.5.9.

    i installed the PHP7 with the following commands:
    Code:
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:ondrej/php-7.0
    sudo apt-get update
    sudo apt-get install php7.0-fpm php7.0-mysql php7.0 libapache2-mod-php7.0
    sudo service apache2 restart
    php is running and ispconfig is working but i get this error after installation
    Code:
    Entpacken von libapache2-mod-php7.0 (7.0.6-4+donate.sury.org~trusty+1) ...
    libapache2-mod-php7.0 (7.0.6-4+donate.sury.org~trusty+1) wird eingerichtet ...
    
    Creating config file /etc/php/7.0/apache2/php.ini with new version
    ERROR: php5 module already enabled, not enabling PHP 7.0
    also i have not updated the pathes in ispconfig for the default PHP and PHP-FPM. the php settings are:
    Code:
    Apache php.ini path   /etc/php5/apache2/php.ini
    CGI php.ini path   /etc/php5/cgi/php.ini
    PHP-FPM init script   php5-fpm
    PHP-FPM php.ini path   /etc/php5/fpm/php.ini
    PHP-FPM pool directory   /etc/php5/fpm/pool.d
    PHP-FPM start port   9010
    PHP-FPM socket directory   /var/lib/php5-fpm
    PHP open_basedir   [website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
    So i have a confused system which throws at "php -v":
    Code:
    PHP 7.0.6-4+donate.sury.org~trusty+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.6-dev, Copyright (c) 1999-2016, by Zend Technologies

    and an ispconfig installation with the old default php5.5.9 with an "info.php" file in ispconfig root www directory:

    Code:
    PHP Version 5.5.9-1ubuntu4.16
    my question. how can i purge php5.5.9 and let ispconfig run properly with php7.0.6? or the other solution purge php7.0.6 and revert to php5.5.9 in commandline like in ispconfig/default?

    I am really confused about my noobish mistake to change a running system :-(

    Best regards chico11mbit

    p.s. i hace no cgi directory in /etc/php/7.0
     
  2. Nilpo

    Nilpo Member HowtoForge Supporter

    I'm having a hard time following because I can't read the German errors. Sorry that I can't help sort this out. However, in the future, it's best not to install software from third-party repositories on a production machine. You should only do in place upgrades from trusted repositories. You can install additional PHP versions (tutorials on HowToForge) without affecting the system version. Then you can choose for each site which version it should run.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    PHP 7 as system PHP requires ISPConfig 3.1, you can't use a system PHP 7 with ISPConfig 3.0.5.x. So you have to try to revert to the prior PHP version. It is highly recommended to not upgrade system PHP versions from thirdparty repositories as Nilpo pointed out, better install additional PHP versions for the websites to have newer and older PHP releases and always keep the system PHP at the version that ships with the OS version of the server.
     
  4. chico11mbit

    chico11mbit Member

    ok. so i have to revert it.
    do you think

    will do the job? or is there a problem, that the php5.5.9 which is already there will not be recognized anymore?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    I haven't used that repository so I can't tell you how to revert to the old version. Maybe you can find something with google or ask the person that has built this PHP repo for instructions on how to revert the changes.
     
  6. chico11mbit

    chico11mbit Member

    thx.

    i thik this thread here saved it for me. thx for help.

    http://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04

    esp. this part of the last post:
    Code:
    from php7.0 to php5.6:
    
    # For php in web apps
    sudo a2dismod php7.0 && sudo a2enmod php5.6 && sudo service apache2 restart
    # For php-cli in the command line
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
     
  7. chico11mbit

    chico11mbit Member

    urrgh. now i get this error when i want to connect to a managed website:

    FEHLER 503 - Dienst nicht verfügbar!
    Folgender Fehler ist aufgetreten:
    Der Dienst ist momentan überlastet. Bitte versuchen Sie es später noch einmal.

    Sollten Sie diese Fehlermeldung öfter erhalten, wenden Sie sich bitte an den Webmaster.


    the ispconfig website is available.

    the errormsg in the log of the website is:

    Code:
    [Fri May 13 14:23:45.574458 2016] [proxy:error] [pid 5804] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9028 (*) failed
    [Fri May 13 14:23:45.574488 2016] [proxy_fcgi:error] [pid 5804] [client X.X.X.X:45831] AH01079: failed to make connection to backend: 127.0.0.1
    
     
    Last edited: May 13, 2016
  8. chico11mbit

    chico11mbit Member

    all websites are running with default php and fast-cgi enabled. When i enable php-fpm with default php and with alternative ph (5.6.10) i get the errors from the previous post.

    ps aux | grep php-fpm
    Code:
    www-data  2219  0.0  0.0 516236  8284 ?        S    17:24   0:00 php-fpm: pool www
    www-data  2220  0.0  0.0 516236  8288 ?        S    17:24   0:00 php-fpm: pool www
    web64     2221  0.0  0.0 516296  8288 ?        S    17:24   0:00 php-fpm: pool web64
    web64     2223  0.0  0.0 516296  8288 ?        S    17:24   0:00 php-fpm: pool web64
    root      2437  0.0  0.0 189996  7032 ?        Ss   17:25   0:00 php-fpm: master process (/opt/php-5.6.10/etc/php-fpm.conf)
    www-data  2438  0.0  0.0 189996  6112 ?        S    17:25   0:00 php-fpm: pool www
    www-data  2439  0.0  0.0 189996  6112 ?        S    17:25   0:00 php-fpm: pool www
    root      2645  0.0  0.0  15616  1016 pts/0    S+   17:25   0:00 grep --color=auto php-fpm
    root      3234  0.0  0.1 516320 24428 ?        Ss   15:45   0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
    
    web64 is the test page, where i have enabled php-fpm. All other pages are with fast-cgi.


    /etc/init.d/php5-fpm status
    Code:
    php5-fpm start/running, process 3234
    any hints to fix this would be great. i think its a configuration error, when i purged php7.0
     
  9. chico11mbit

    chico11mbit Member

    ok. after investigation i found out, that the port in
    /etc/apache2/sites-enabled/100-DOMAIN.de.vhost
    ist set to 9073.
    Code:
    <IfModule mod_proxy_fcgi.c>
                            ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:9073/var/www/clients/client1/web64/web/$1
                    </IfModule>
    when i set it manually to 8998 (the alternative PHP5.6.10 is listening to that port) it works and the site is shown normally. Also when i uncheck the "Use-socket" option in the Web Domain options in ispconfig it runs flawlessly.

    Does anyone know why this port is set to 9073 when i change the PHP mode to PHP-FPM in ispconfig? this port is used when i change the php mode to default/php-fpm and also when i change it to the alternative php version and php-fpm.
     
    Last edited: May 13, 2016
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Ech websites uses a dedicated port to connect to the correct php-fpm instance when tcp connections are used. Using a different port makes it basically to connect to the php-fpm of another website so that php runs under a wrong user. So the port change that you made manually might have worked on the first glance but you have switched the php user to www-data by that, which can be a security issue and will cause cms systems to fail to write to the website. Most likely the php-fpm gt not restarted properly (this can happen when there is a mix of init scripts and systemd units. If your server uses systemd, then you can e.g. try to remove the init script for php 5.6 and create a systemd unit for it. Or you use sockets, which is faster anyway.
     
  11. chico11mbit

    chico11mbit Member

    thx Till,
    after more investigation i found the following:
    i get a 503 error when i activate "Use Socket For PHP-FPM".

    When i deactivate it all went fine and every PHP-FPM instance get an TCP port automatically. This happens whith the default 5.5.9 PHP-FPM and also with the PHP-FPM from 5.6.10, which i installed a long time ago. In the past this was no problem since the update to php7.0 which was beside the 5.5.9 then on the system. And after purging the 7.0 installation this problem occures.
    Also all Alias-Links like PHP-MyAdmin and Roundcube in e.g. http://www.domain/phpmyadmin gives back "No file found" and nothing else. When i use 192.168.1.1/phpmyadmin or server.domain/phpmyadmin all is fine.

    I think that is also a problem with the socket connection and my question is: How can i fix this so that my system works with sockets like before?

    Best regards

    Chico
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Any errors in ispconfig debug mode when you switch php?
     
  13. chico11mbit

    chico11mbit Member

    Nope.

    Code:
    2016-05-17 13:41    server3.domain.de    Debug    Processed datalog_id 4055   
    2016-05-17 13:41    server3.domain.de    Debug    Apache online status after restart is: running   
    2016-05-17 13:41    server3.domain.de    Debug    Apache restart return value is: 0   
    2016-05-17 13:41    server3.domain.de    Debug    Restarting httpd: service apache2 restart   
    2016-05-17 13:41    server3.domain.de    Debug    Calling function 'restartHttpd' from module 'web_module'.   
    2016-05-17 13:41    server3.domain.de    Debug    Apache status is: running   
    2016-05-17 13:41    server3.domain.de    Debug    Restarting php-fpm: service php-5.6.10-fpm reload   
    2016-05-17 13:41    server3.domain.de    Debug    Calling function 'restartPHP_FPM' from module 'web_module'.   
    2016-05-17 13:41    server3.domain.de    Debug    Writing the PHP-FPM config file: /opt/php-5.6.10/etc/pool.d/web19.conf   
    2016-05-17 13:41    server3.domain.de    Debug    Writing the vhost file: /etc/apache2/sites-available/domain.de.vhost   
    2016-05-17 13:41    server3.domain.de    Debug    Enable SSL for: www.domain.de   
    2016-05-17 13:41    server3.domain.de    Debug    Calling function 'update' from plugin 'apache2_plugin' raised by event 'web_domain_update'.
    2016-05-17 13:41    server3.domain.de    Debug    Enable SSL for: www.domain.de   
    2016-05-17 13:41    server3.domain.de    Debug    Calling function 'update' from plugin 'apache2_plugin' raised by event 'web_domain_update'.   
    2016-05-17 13:41    server3.domain.de    Debug    Calling function 'ssl' from plugin 'apache2_plugin' raised by event 'web_domain_update'.   
    2016-05-17 13:41    server3.domain.de    Debug    Found 1 changes, starting update process.
     

Share This Page