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/mydomain.com/public_html/nextcloud/lib/versioncheck.php) is not within the allowed path(s): (/dev/urandom) in /var/www/mydomain.com/public_html/nextcloud/cron.php on line 39
PHP Warning: require_once(/var/www/mydomain.com/public_html/nextcloud/lib/versioncheck.php): failed to open stream: Operation not permitted in /var/www/mydomain.com/public_html/nextcloud/cron.php on line 39
PHP Fatal error: require_once(): Failed opening required ‘/var/www/mydomain.com/public_html/nextcloud/lib/versioncheck.php’ (include_path=’.:/usr/share/php’) in /var/www/mydomain.com/public_html/nextcloud/cron.php on line 39 mydomain.com System:
Debian 10
Apache
php7.3
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
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.