ISPConfig PHP open_basedir restriction

Discussion in 'Installation/Configuration' started by Niubbo75, Aug 11, 2022.

  1. Niubbo75

    Niubbo75 Member

    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 10 (buster)
     
    [INFO] uptime:  10:28:40 up 2 days,  2:06,  2 users,  load average: 0.00, 0.00, 0.00
     
    [INFO] memory:
                  total        used        free      shared  buff/cache   available
    Mem:          1.9Gi       301Mi       1.2Gi        13Mi       462Mi       1.5Gi
    Swap:         1.0Gi       539Mi       484Mi
     
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.8p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4
    [INFO] php-cgi (used for cgi php in default vhost!) is version 7.3.33
    
    ##### PORT CHECK #####
    
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Apache 2 (PID 23826)
    [INFO] I found the following mail server(s):
        Postfix (PID 1233)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 595)
    [INFO] I found the following imap server(s):
        Dovecot (PID 595)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 1024)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [localhost]:10026        (1267/amavisd-new)
    [anywhere]:587        (1233/master)
    [localhost]:11211        (565/memcached)
    [anywhere]:110        (595/dovecot)
    [anywhere]:143        (595/dovecot)
    [anywhere]:465        (1233/master)
    [anywhere]:21        (1024/pure-ftpd)
    ***.***.***.***:53        (634/named)
    [localhost]:53        (634/named)
    [anywhere]:22        (1585/sshd)
    [anywhere]:25        (1233/master)
    [localhost]:953        (634/named)
    [anywhere]:993        (595/dovecot)
    [anywhere]:995        (595/dovecot)
    [localhost]:10023        (769/postgrey)
    [localhost]:10024        (1267/amavisd-new)
    *:*:*:*::*:10026        (1267/amavisd-new)
    *:*:*:*::*:3306        (764/mysqld)
    *:*:*:*::*:587        (1233/master)
    [localhost]10        (595/dovecot)
    [localhost]43        (595/dovecot)
    *:*:*:*::*:8080        (23826/apache2)
    *:*:*:*::*:80        (23826/apache2)
    *:*:*:*::*:8081        (23826/apache2)
    *:*:*:*::*:465        (1233/master)
    *:*:*:*::*:21        (1024/pure-ftpd)
    *:*:*:*::*:53        (634/named)
    *:*:*:*::*:22        (1585/sshd)
    *:*:*:*::*:25        (1233/master)
    *:*:*:*::*:953        (634/named)
    *:*:*:*::*:443        (23826/apache2)
    *:*:*:*::*:993        (595/dovecot)
    *:*:*:*::*:995        (595/dovecot)
    *:*:*:*::*:10023        (769/postgrey)
    *:*:*:*::*:10024        (1267/amavisd-new)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    f2b-sshd   tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 22
    f2b-ssh    tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 22
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain f2b-ssh (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    Chain f2b-sshd (1 references)
    target     prot opt source               destination         
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0           
    
    
    
    
    ##### LET'S ENCRYPT #####
    acme.sh is installed in /root/.acme.sh/acme.sh
    
    
    
    Code:
    lsb_release -a
    No LSB modules are available.
    Distributor ID:Debian
    Description:Debian GNU/Linux 10 (buster)
    Release:10
    Codename:buster
    Code:
    php -v
    PHP Warning:  PHP Startup: Unable to load dynamic library 'memcache.so' (tried: /usr/lib/php/20180731/memcache.so (/usr/lib/php/20180731/memcache.so: cannot open shared object file: No such
    file or directory), /usr/lib/php/20180731/memcache.so.so (/usr/lib/php/20180731/memcache.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP 7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4 (cli) (built: Jun 27 2022 08:11:59) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4, Copyright (c) 1999-2018, by Zend Technologies
    Hello, I'm having problem trying to publish a Drupal 9 website created via composer, I've move all files via FTP but I still get an error 500, if a read apache error log i can see this:
    Code:
    [Thu Aug 11 10:24:46.484226 2022] [proxy_fcgi:error] [pid 23864] [client ***.***.***.***:42043] AH01071: Got error 'PHP message: PHP Warning:  require(): open_basedir restriction in effect. File(/var/www/clients/client1/web1/vendor/autoload.php) is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/arcasafe.eu/web:/srv/www/arcasafe.eu/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client1/web1/web/autoload.php on line 16PHP message: PHP Stack trace:PHP message: PHP   1. {main}() /var/www/clients/client1/web1/web/index.php:0PHP message: PHP   2. require_once() /var/www/clients/client1/web1/web/index.php:14PHP message: PHP Warning:  require(/var/www/clients/client1/web1/vendor/autoload.php): Failed to open stream: Operation not permitted in /var/www/clients/client1/web1/web/autoload.php on line 16PHP message: PHP Stack trace:PHP message: PHP   1. {main}() /var/www/clients/client1/web1/web/index.php:0PHP message: PHP   2. require_once() /var/www/clients/client1/web1/web/index.php:14PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/var/www/clients/client1/web1/web/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/clients/client1/web1/web/autoload.php:16\nStack trace:\n#0 /var/www/clients/client1/web1/web/index.php(14): require_once()\n#1 {main}\n  thrown in /var/www/clients/client1/web1/web/autoload.php on line 16'
    I've try under ISPConfig -> System -> Server Config -> MyServer -> Web -> PHP Settings -> PHP open_basedir:
    Code:
    [website_path]/web:[website_path]/private:[website_path]/tmp:[website_path]/vendor:/var/www/[website_domain]/web:/var/www/[website_domain]/vendor:/srv/www/[website_domain]/web:/srv/www/[website_domain]/vendor:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
    but I still have the same issue, how can I solve it?
    Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's the wrong setting. This is only the default for new sites. For existing sites, edit the open_basedir setting on the options tab of the website.
     
    Niubbo75 likes this.
  3. Niubbo75

    Niubbo75 Member

    Till you are right, as usual! Now I have another issue, I can't navigate D9 website, any link I try I got a 404 and I have nothing in logs, IMHO could be related to "Clean URLs" but I've check to load a page using /?q=user/login or /?q=node/1 but I still have home page re-loaded. Any idea on what could be the issue?
    [EDIT] I find the issue, lost .htaccess in /web folder, upload it and all works as expected! [/EDIT]
     
    Last edited: Aug 11, 2022

Share This Page