Another "open_basedir restriction in effect"

Hi there:

I’m using Hestia 1.4.17 on Ubuntu 20.04

I’ve a site made with phpmaker working. My problem is, when I turn debug mode on, it tries to save a log in: /home/%user%/web/%domain%/logs, then the site doesn’t work and I get the error:

[Tue Oct 26 09:22:26.087817 2021] [proxy_fcgi:error] [pid 22353:tid 140524409251584] [client x.x.x.x:0] AH01071: Got error 'PHP message: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/logs/log-2021-10-26.log) is not within the allowed path(s): (/home/semi/.composer:/home/semi/web/testdomain.ddns.net/public_html:/home/semi/web/testdomain.ddns.net/private:/home/semi/web/testdomain.ddns.net/public_shtml:/home/semi/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) in /home/semi/web/testdomain.ddns.net/public_html/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php on line 117PHP message: PHP Warning:  is_dir(): open_basedir restriction in effect. File(/logs) is not within the allowed path(s): (/home/semi/.composer:/home/semi/web/testdomain.ddns.net/public_html:/home/semi/web/testdomain.ddns.net/private:/home/semi/web/testdomain.ddns.net/public_shtml:/home/semi/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) in /home/semi/web/testdomain.ddns.net/public_html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 210PHP message: PHP Warning:  is_dir(): open_basedir restriction in effect. File(/logs) is not within the allowed path(s): (/home/semi/.composer:/home/semi/web/testdomain.ddns.net/public_html:/home/semi/web/testdomain.ddns.net/private:/home/semi/web/testdomain.ddns.net/public_shtml:/home/semi/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) in /home/semi/web/testdomain.ddns.net/public_html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 215PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: There is no existing directory at "/logs" and it could not be created: open_basedir restriction in effect. File(/logs) is not within the allowed path(s): (/home/semi/.composer:/home/semi/web/testdomain.ddns.net/public_html:/home/semi/web/testdomain.ddns.net/private:/home/semi/web/partestelco.ddns.net/public_shtml:/home/semi/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt)

I’ve tried to add the path (/home/%user%/web/%domain%/logs) in several files to the php_admin_value[open_basedir] directive:

The point is, none of these files seems to be the right, because the path I’ve added is not found. If I search for a part of that file (/home/semi/.composer) with grep -r “/home/semi/.composer:” * it’s just found in /etc/php/7.4/fpm/php.ini /etc/php/8.0/fpm/php.ini.

What more can I try?

Thanks in advance

You write to /logs/logs-2021-10-26.log and not /home/user/web/domain/logs/ folder

Oh my¡¡

Thanks, you’re right, I forgot the …/ before logs in the config file…

Sorry and thanks again¡

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.