ispconfig 3.1.6/debain 9.1/php 7/php-fpm not working

Discussion in 'Installation/Configuration' started by brisk, Sep 3, 2017.

  1. brisk

    brisk Member

    Clean install.. when i create the website I checked PHP to use PHP-FPM.
    I placed a simple phpinfo.php file in the web folder of my site, it is not working, I saw this error in error.log

    Code:
    [Sun Sep 03 12:19:07.891144 2017] [proxy:error] [pid 9683] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php5-fpm/web3.sock (*) failed
    [Sun Sep 03 12:19:07.891237 2017] [proxy_fcgi:error] [pid 9683] [client 24.54.13.187:55986] AH01079: failed to make connection to backend: httpd-UDS
    
    So I checked my system, not file in that folder. Searched the whole folder, no such file.

    Then i checked php-fpm config, and the socket file is indeed in this path:

    Code:
    /run/php/php7.0-fpm.sock
    
    So I changed the conf for my site from
    Code:
    <IfModule mod_proxy_fcgi.c>
                            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web3.sock|fcgi://localhost//var/www/clients/client1/web3/web/$1
                            <Directory /var/www/clients/client1/web3/web>
                                    <FilesMatch "\.php[345]?$">
                                                    SetHandler "proxy:unix:/var/lib/php5-fpm/web3.sock|fcgi://localhost"
                                    </FilesMatch>
                            </Directory>
                            </IfModule>
    
    
    to

    Code:
    <IfModule mod_proxy_fcgi.c>
                            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php5-fpm/web3.sock|fcgi://localhost//var/www/clients/client1/web3/web/$1
                            <Directory /var/www/clients/client1/web3/web>
                                    <FilesMatch "\.php[345]?$">
                                                    SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
                                    </FilesMatch>
                            </Directory>
                            </IfModule>
    
    
    Now my site is working.
    So I am wondering is this something wrong with my setup or install? I have no problem update each site I create, but just want to make sure I am doing something right.
    thanks
     
  2. HSorgYves

    HSorgYves Member HowtoForge Supporter

    Paste your php settings from Server Config in ISPConfig. There must be something wrong there...
     
  3. brisk

    brisk Member

    which file?
     
  4. HSorgYves

    HSorgYves Member HowtoForge Supporter

    No File. ISPConfig Backend, System -> Server Config -> Web -> PHP Settings
     
  5. brisk

    brisk Member

    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
    Check php.ini every X minutes for changes: 1 (0 = no check)
    Default PHP Handler: Disabled
    
     
  6. HSorgYves

    HSorgYves Member HowtoForge Supporter

    This is a php 5 configuration, you said you would use php 7? If yes, change the following and try again:
    Apache php.ini path: /etc/php/7.0/apache2/php.ini
    CGI php.ini path: /etc/php/7.0/cgi/php.ini
    PHP-FPM init script: php7.0-fpm
    PHP-FPM php.ini path: /etc/php/7.0/fpm/php.ini
    PHP-FPM pool directory: /etc/php/7.0/fpm/pool.d
    PHP-FPM socket directory: /var/lib/php7.0-fpm
     
  7. brisk

    brisk Member

  8. HSorgYves

    HSorgYves Member HowtoForge Supporter

    The VM from that tutorial also has php5 in open_basedir...
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    You can append all paths with : to that settings that shall be reachable, so you can add any other directory for PHP7 there as well.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    @brisk: Please post the content of the following files from your system:

    /etc/os-release
    /etc/debian_version
    /etc/issue
     
  11. brisk

    brisk Member

    Code:
    [email protected]:~$ cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
    NAME="Debian GNU/Linux"
    VERSION_ID="9"
    VERSION="9 (stretch)"
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    [email protected]:~$ cat /etc/debian_version
    9.1
    [email protected]:~$ cat /etc/issue
    Debian GNU/Linux 9 \n \l
    
    [email protected]:~$
    
     

Share This Page