[BlueOnyx:26431] Re: Open_basedir errors

Juerg Sommer jsommer at emailto.ch
Sat Sep 2 11:43:15 -05 2023


Hi Colin

> We have a customer with a vsite that includes a PHP script to flush their database regularly to clear old records.
> The script works fine if run from a web browser (http://www.domain.com/cron.php) but when I try and run as a cron job I get open_basedir errors:
>
> PHP Warning:  include(): open_basedir restriction in effect. File(/home/.sites/90/site26/web/control/cfg.php) is not within the allowed path(s)
>
> It runs okay from the website so wondered where the problem is.
> I have fiddled about a bit without success.
>
> /usr/bin/php /home/.sites/90/site26/web/cron.php
Try
/usr/bin/php -d open_basedir=none /home/.sites/90/site26/web/cron.php

Because command line can not differ between VSites, there's on VSite 
allowed by default. Can be changed on GUI in Server configuration, but I 
recommend to extend the command line to prevent security holes for other 
scripts.

Hope that will help.

Best regards,
Juerg



More information about the Blueonyx mailing list