Cron php7.3 with errors

Hi, Can’t run cron at my server and facing this errors " Last job execution ran 12 minutes ago. Something seems wrong. "
$ php cron.php
PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/ is not within the allowed path(s): (/dev/urandom) in /var/www/ on line 39
PHP Warning: require_once(/var/www/ failed to open stream: Operation not permitted in /var/www/ on line 39
PHP Fatal error: require_once(): Failed opening required ‘/var/www/’ (include_path=’.:/usr/share/php’) in /var/www/ on line 39
Debian 10


Make sure that the web server user, under which you run the script, is allowed to access the /dev/urandomdevice. On my server the access rights are set as follows:

# ls -ald /dev /dev/urandom
drwxr-xr-x 13 root root 16360 Nov 22 00:02 /dev
crw-rw-rw-  1 root root  1, 9 Oct 29 11:27 /dev/urandom

mine is the same
ls -ald /dev /dev/urandom
drwxr-xr-x 18 root root 3460 Nov 26 12:34 /dev
crw-rw-rw- 1 root root 1, 9 Nov 26 12:34 /dev/urandom

What is your actual open_basedir configuration ?

with /dev/urandom or disabled no value is the same error!

Well, if it says that open_basedir is in effect, it’ because it is. So it is not correctly disabled…

Create a file named e.g. info.php which contains the line “<?php phpinfo() ?>” in your web server document root directory. Open it using your preferred web browser and check the displayed php settings, especially the “open_basedir” one. It shouldn’t be set at all by default.

with or without is the same! the php ini is located here /etc/php/7.3/apache2/php.ini it works fine.

With or without value give the same error. the php.ini located here /etc/php/7.3/apache2/php.ini is the correct one.

Hi, are you running the script by www-data user? yesterday I was fixing mine by following the official documentation, and it was really useful.