chroot error

Discussion in 'Installation/Configuration' started by COLVIT, Feb 2, 2026.

  1. COLVIT

    COLVIT New Member

    hi,
    i tried to run a wordpress in chrooted env.
    But i faced an issue :
    Code:
    [crit] 712871#712871: *17 openat() "/var/www/domain.fr/web/" failed (13: Permission denied), client: 92.184.100.241, server: domain.fr, request: "GET / HTTP/2.0", host: "www.domain.fr"
    [error] 712871#712871: *17 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /web/wp-includes/class-wpdb.php on line 1988" while reading response header from upstream, client: 92.184.100.241, server: domain.fr, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/web11.sock:", host: "www.domain.fr"
    any idea on how to make it works ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Use 127.0.0.1 and not localhost to connect to MySQL when the site is in a chroot environment.
     
  3. COLVIT

    COLVIT New Member

    the chroot prevent resolving localhost ? :eek:
     
  4. COLVIT

    COLVIT New Member

    not really better :
    Code:
    [crit] 723839#723839: *742 openat() "/var/www/domain.fr/web/" failed (13: Permission denied)
    [error] 723839#723839: *742 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    No. Localhost in terms of a mysql connection, is a socket in the root filesystem outside of the chroot.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you have the filesystem where /var/www is on mounted over the network e.g. from NFS?
     
  7. COLVIT

    COLVIT New Member

    nope, 100% local
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    And the PHP file you try to execute belongs to the web user of this website and the client group of this website?
     
  9. COLVIT

    COLVIT New Member

    perms are ok on the web folder. Nothing has been changed on the default config
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    What you can try is to temporarily change the web folder permissions:

    web-perms.png

    Change the web folder with chmod, use chattr -i .... on web root to unlock it. When you know which one works, set it under System > server config > web > Permissions in the field I posted the screenshot from.
     
    ahrasis and COLVIT like this.

Share This Page