PHP7.2-FPM new install with running ipsconfig

Discussion in 'Installation/Configuration' started by Bent Brüggemann, Dec 2, 2018.

  1. Bent Brüggemann

    Bent Brüggemann New Member

    Hey Guys,

    My issue
    I have recently migrated to ubuntu 18.04 server with nginx 1.15.7, ispconfig 3 (latest) and (now) php7.2. Before that the server ran on php7.0.
    So I thought of having it a bit cleared up and uninstalled php7.0 (yeah, wasn't too smart).
    This does mean, that ispconfig does not find PHP anymore.

    After I changed path to socket in nginx/sites-enabled/ for my sites and ispconfig the sites do run again (on php7.2) but ispconfig has an issue with it due to permissive errors:
    249 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/usr/local/ispconfig/interface/lib/config.inc.php): failed to open stream: Permission denied in /usr/local/ispconfig/interface/web/index.php on line 31
    What I basically did to produce it was to change php-fpm socket to /run/php/php7.2-fpm.sock which works for regular websites but not for ispconfig.

    Questions
    • How can I reconfigure ISPConfig to get new php version?
      Updating the version of ISPConfig did not change it. Installing is not permitted due to already having some installation
    • I recognised that every website had it's own socket before (likewise web11.sock), how can I re-establish this usage again?

    Thanks for ideas :)

    Bent
     
    Last edited: Dec 2, 2018
  2. ahrasis

    ahrasis Well-Known Member

    You add additional php7.2 to your ISPConfig settings then change each website to use it.
     
  3. Bent Brüggemann

    Bent Brüggemann New Member

    Hey ahrasis,

    Thx for your answer. But where?
    This does mean ispconfig is broken and produces a http 500. See my posted error above.

    -> this must be somewhere terminal-wise. Where?

    Cheers,
    Bent
     
  4. Bent Brüggemann

    Bent Brüggemann New Member

    BTW changing nginx conf in site-enabled (as I did) is not valid. ISPConfig would override it as soon as it's working again correctly.
    Basically I'm looking fo a way to fix ISPConfig.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Install the correct PHP version for the OS again, that's the one that you can find on the perfect server guide four OS.
    2) then do a manual ISPConfig update with reconfigure services = yes:

    Code:
    cd /tmp
    wget http://www.ispconfig.org/downloads/ISPConfig-3.1.13.tar.gz
    tar xvfz ISPConfig-3.1.13.tar.gz
    cd ispconfig3_install/install
    php -q update.php
    You can run older and newer PHP version than the version that ships with the OS as additional PHP version (either manually compiled or from a PPA repo like ondrej), but do not change the default PHP as this will break the system.
     
  6. Bent Brüggemann

    Bent Brüggemann New Member

    Hey Till,

    Thx for your answer. Unfortunately this did not work out. ISPConfig still does not know where to go for correct php socket.
    I hoped that an update (with reconfiguring) will fix the nginx file for ispconfig (for correct php-fpm socket).
    But that's what I did. :(
    In my naive world I though easily to replace PHP with another version.

    Can I reinstall ISPConfig?
    Is there an uninstall script? Or should I go through the folders and delete by hand?
    Os is there another option to setup again correct nginx conf to have IPSConfig run again?

    Cheers,
    Bent
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Have you changed the default PHP version back to the original for Ubuntu 18.04?
    Code:
    update-alternatives --config php
    If you have installed that original PHP back and done the update-alternatives, try again manual ISPConfig update.
     
  8. Bent Brüggemann

    Bent Brüggemann New Member

    I did not change default PHP for Ubuntu 18.04:
    Code:
    update-alternatives --config php:
    There is only one alternative in link group php (providing /usr/bin/php): /usr/bin/php7.2
    Nothing to configure.
    
    So my history was to upgrade from 16.04 to 18.04 which sets PHP7.0 to deprecated one.
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  10. Bent Brüggemann

    Bent Brüggemann New Member

    Hey Teleman,

    Thx for this suggestion.
    I tried https://www.howtoforge.com/tutorial/perfect-server-ubuntu-18-04-nginx-bind-dovecot-and-ispconfig-3/ and got same result.

    Is there a way to re-initialise ngnix configuration for ispconfig?
    Currently I still get
    Code:
    2018/12/02 19:58:38 [error] 19256#19256: *3596 FastCGI sent in stderr: "PHP message: PHP Warning:  require_once(/usr/local/ispconfig/interface         /lib/config.inc.php): failed to open stream: Permission denied in /usr/local/ispconfig/interface/web/index.php on line 31
    PHP message: PHP Fatal error:  require_once(): Failed opening required '../lib/config.inc.php' (include_path='.:/usr/share/php') in /usr/local         /ispconfig/interface/web/index.php on line 31" while reading response header from upstream, client: 31.17.211.231, server: _, request: "GET /          HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "
    XXXXX"
    
    My nginx site-enabled for ispconfig:
    Code:
            location ~ \.php$ {
                   try_files $uri =404;
                   include /etc/nginx/fastcgi_params;
                   fastcgi_pass unix:/run/php/php7.2-fpm.sock;
                   fastcgi_index index.php;
                   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                   #fastcgi_param PATH_INFO $fastcgi_script_name;
                   fastcgi_buffer_size 128k;
                   fastcgi_buffers 256 4k;
                   fastcgi_busy_buffers_size 256k;
                   fastcgi_temp_file_write_size 256k;
                   fastcgi_read_timeout 1200;
                               fastcgi_param HTTP_PROXY "";
            }
    
    
    What I changed after upgrade of ubuntu was fastcgi_pass unix:/run/php/php7.2-fpm.sock;

    Cheers
     
  11. ahrasis

    ahrasis Well-Known Member

    No. This is in ISPConfig CP > System > Additional PHP Versions.

    My reply is only for websites php version only. For ISPConfig php version refer to @till 's reply.
     
  12. Bent Brüggemann

    Bent Brüggemann New Member

    Hey guys,
    @till @Taleman as far as I see I ran through installation guide https://www.howtoforge.com/tutorial/perfect-server-ubuntu-18-04-nginx-bind-dovecot-and-ispconfig-3 mulitple times for upgraded server from ubuntu 16.04.

    Error still persists that nginx is not able to access /usr/local/ispconfig/interface/web/index.php.
    May the issue be hidden somewhere here? With which user should nginx usually access ispconfig?
    upload_2018-12-3_21-4-6.png
    Afaik ngnix is using a different one:
    upload_2018-12-3_21-5-49.png
    (/var/log/nginx/error.log)

    I still fear the complete reinstall of servers so I would like to find the issue :)
    Any suggestions still not yet tried?

    Regards,
    Bent
     
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Now that correct PHP version is installed with proper setup, have you tried what @till suggested in #5? The update.php should work now and lets you reconfigure services and ISPConfig should work.
     
  14. Bent Brüggemann

    Bent Brüggemann New Member

    Hey @Taleman,

    Yes I ran a couple of times through it. No changes so far:
    upload_2018-12-4_22-0-26.png

    :(
     
  15. Bent Brüggemann

    Bent Brüggemann New Member

    Hey Guys,

    Thx for your answers, as it turned out:
    ISPConfig is creating php configs for every vhost in /etc/php/php7.0/fpm/pool.d/ispconfig.conf.
    So I found that reinstallation only created one conf for apps (/etc/php/php7.2/fpm/pool.d/apps.conf) but not for all vhosts and ispconfig itself. In these conf's sockets for each vhost is defined for which php is listening and nginx must reference to it.

    So I moved old vhost confs in pool.d of php7.0 to 7.2 (and changed listen):
    upload_2018-12-4_23-53-50.png
    and changed vhost config in nginx sites-available for ispconfig:
    upload_2018-12-4_23-55-40.png

    -> so now ispconfig is working again. It fixes automatically all nginx vhosts (as I tried to change some and missed undoing so).

    I found this solution due to my already mentioned question why nginx was complaining about the right to open /usr/local/ispconfig/interface/web/.

    One Question remains:
    What happens if I'm creating new sites (aka vhosts)? Will nginx know of current php version? Where can I set this up? Can I?

    Best,
    Bent
     
    ahrasis likes this.
  16. Jesse Norell

    Jesse Norell Well-Known Member

    I didn't re-read the thread to make sure I'm following everything, but I think what you want is the default php version settings under System > Server Config > {server} > Web > PHP Settings.
     
    biforme and ahrasis like this.

Share This Page