Multiple PHP version problem Ubuntu 16.04

Discussion in 'General' started by Kaitum, Mar 22, 2019.

  1. Kaitum

    Kaitum New Member

    Hello guys,

    I followed this manual to install multiple PHP versions - currently have PHP 7.0 nad 7.2 running.
    https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/#-enable-php-in-ispconfig-2

    Erything works fine till I want to switch from 7.2 FPM back to 7.0 FPM

    Basically when I select PHP 7.2 webxxx.conf is created in proper directory of selected php version in my case /opt/php-7.2/etc/php-fpm.d and same file is deleted from /etc/php/7.0/fpm/pool.d and both services are reloaded.
    Problem starts when I want to switch from 7.2 or newer version back to 7.0. Config file webxxx.conf should be deleted from /opt/php-7.2/etc/php-fpm.d and created in /etc/php/7.0/fpm/pool.d. Unfortunately this file is not deleted and remains in /opt/php-7.2/etc/php-fpm.d so when php 7.0 service is reloaded it fails to start because both PHP version try to listen on /var/lib/php7.0-fpm/webxxx.sock.

    ERROR: An another FPM instance seems to already listen on /var/lib/php7.0-fpm/web233.sock

    This happens only when I try to switch PHP version for the same website.

    Any ideas how to fix this?

    thank you very much!!

    Regards
    Jiri
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Use ISPConfig debug mode to find out why the old pool file could not be removed.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    If you started the php 7.2 with an init script instead of using systemctl command, then it can not be reloaded or restarted with systemd which means ispconfig is not able to reload it successfully. To be sure that you don't have this issue, stop php 7.2 fpm, check with ps command that it is really stopped and then start it with systemctl command. And your php 7.2 should have a www pool file which ensures that there is at least one pool active even if there is no ispconfig website using that php version.
     
  4. Kaitum

    Kaitum New Member

    I started it with systemctl...same issue. If I switch version from 7.2 to 7.0 I can see this in log files

    Mar 22 13:11:03 nginxa-mnps0036 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid:
    Invalid argument
    Mar 22 13:11:03 nginxa-mnps0036 systemd[1]: Started A high performance web server and a reverse proxy server.
    Mar 22 13:11:03 nginxa-mnps0036 systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
    Mar 22 13:11:03 nginxa-mnps0036 systemd[1]: php7.0-fpm.service: Unit entered failed state.
    Mar 22 13:11:03 nginxa-mnps0036 systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

  6. Kaitum

    Kaitum New Member

    There are no errors when I run ./server.sh manualy.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Please follow the full instructions, enable debug mode, comment out server.sh cronjob, then do the failing action in ispconfig UI, run server.sh and post the debug result.
     
  8. Kaitum

    Kaitum New Member

    Hello,

    here is ./server.sh output after I switched from PHP 7.2 to PHP 7.0 even if ISPC shows PHP 7.0 is selected website still runs on PHP 7.2

    25.03.2019-10:28 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    25.03.2019-10:28 - DEBUG - Found 1 changes, starting update process.
    25.03.2019-10:28 - DEBUG - Replicated from master: REPLACE INTO `web_domain` (`domain_id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`ip_address`,`ipv6_address`,`domain`,`type`,`parent_domain_id`,`vhost_type`,`document_root`,`web_folder`,`system_user`,`system_group`,`hd_quota`,`traffic_quota`,`cgi`,`ssi`,`suexec`,`errordocs`,`is_subdomainwww`,`subdomain`,`php`,`ruby`,`python`,`perl`,`redirect_type`,`redirect_path`,`seo_redirect`,`rewrite_to_https`,`ssl`,`ssl_letsencrypt`,`ssl_letsencrypt_exclude`,`ssl_state`,`ssl_locality`,`ssl_organisation`,`ssl_organisation_unit`,`ssl_country`,`ssl_domain`,`ssl_request`,`ssl_cert`,`ssl_bundle`,`ssl_key`,`ssl_action`,`stats_password`,`stats_type`,`allow_override`,`apache_directives`,`nginx_directives`,`php_fpm_use_socket`,`pm`,`pm_max_children`,`pm_start_servers`,`pm_min_spare_servers`,`pm_max_spare_servers`,`pm_process_idle_timeout`,`pm_max_requests`,`php_open_basedir`,`custom_php_ini`,`backup_interval`,`backup_copies`,`backup_excludes`,`active`,`traffic_quota_lock`,`fastcgi_php_version`,`proxy_directives`,`enable_spdy`,`last_quota_notification`,`rewrite_rules`,`added_date`,`added_by`,`directive_snippets_id`,`enable_pagespeed`,`http_port`,`https_port`,`folder_directive_snippets`,`log_retention`) VALUES ('233','1','2','riud','ru','','11','*','','jb.test','vhost','0','name','/var/www/clients/client1/web233','','web233','client1','-1','-1','n','n','y','1','1','none','php-fpm','n','n','n',NULL,NULL,NULL,'n','n','n','n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'awstats','All',NULL,NULL,'y','dynamic','10','2','1','5','10','0','/var/www/clients/client1/web233/web:/var/www/clients/client1/web233/private:/var/www/clients/client1/web233/tmp:/var/www/jb.test/web:/srv/www/jb.test/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom',NULL,'none','1',NULL,'y','n','',NULL,'n',NULL,NULL,'2019-03-22','admin','0','n','80','443',NULL,'1')
    25.03.2019-10:28 - DEBUG - Calling function 'ssl' from plugin 'nginx_plugin' raised by event 'web_domain_update'.
    25.03.2019-10:28 - DEBUG - Calling function 'update' from plugin 'nginx_plugin' raised by event 'web_domain_update'.
    25.03.2019-10:28 - DEBUG - SSL Disabled. jb.test
    25.03.2019-10:28 - DEBUG - Writing the vhost file: /etc/nginx/sites-available/jb.test.vhost
    25.03.2019-10:28 - WARNING - No awstats base config found. Either awstats.conf or awstats.model.conf must exist in /etc/awstats.
    25.03.2019-10:28 - DEBUG - Writing the PHP-FPM config file: /etc/php/7.0/fpm/pool.d/web233.conf
    25.03.2019-10:28 - DEBUG - Calling function 'restartPHP_FPM' from module 'web_module'.
    25.03.2019-10:28 - DEBUG - Restarting php-fpm: systemctl reload php7.0-fpm.service
    25.03.2019-10:28 - DEBUG - nginx status is: running
    25.03.2019-10:28 - DEBUG - Calling function 'restartHttpd' from module 'web_module'.
    25.03.2019-10:28 - DEBUG - Checking nginx configuration...
    25.03.2019-10:28 - DEBUG - nginx configuration ok!
    25.03.2019-10:28 - DEBUG - Restarting httpd: systemctl restart nginx.service
    25.03.2019-10:28 - DEBUG - nginx restart return value is: 0
    25.03.2019-10:28 - DEBUG - nginx online status after restart is: running
    25.03.2019-10:28 - DEBUG - Processed datalog_id 3351
    25.03.2019-10:28 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    How did you check that? Put an info.php file into the web directory with this content:

    <?php
    phpinfo();

    then call info.php in a web browser and check which PHP version is shown by the phpinfo() command.
     
  10. Kaitum

    Kaitum New Member

    I did

    upload_2019-3-25_12-48-33.png


    And this is an output of testing page

    upload_2019-3-25_12-49-42.png
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the file /etc/php/7.0/fpm/pool.d/web233.conf exist? If yes, use systemctl command to restart php 7.2 and then 7.0 fpm daemon and test again.
     
  12. Kaitum

    Kaitum New Member

    Yes file exists. If I switch from PHP 7.0 to 7.2 this file is deleted and created in /opt/php-7.2/etc/php-fpm.d. If I want to switch back to PHP 7.0 file web233.conf should be deleted and created in /etc/php/7.0/fpm/pool.d/web233.conf. But this file remains in /opt/php-7.2/etc/php-fpm.d and is also created in /etc/php/7.0/fpm/pool.d so php 7.0 fpm service php 7.0 fails to start.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Really strange, never seen that the pool file could not be deleted. Your ISPConfig version is 3.1.13p1 ?
     
  14. Kaitum

    Kaitum New Member

    I moved to Debian and everything works perfectly!

    thanks!
     

Share This Page