Fatal error: require_once(): Failed opening required phpminimumversionlib.php'

Fatal error: require_once(): Failed opening required phpminimumversionlib.php'

by studyingroup com -
Number of replies: 3

Hi all!

I'm trying to install Moodle on my local Arch linux, with Httpd as my server (and MariaDB).

Now, I'm at the point where I'm launching the installer via the command line:

[CODE]

$ sudo /usr/bin/php /var/www/html/moodle/admin/cli/install.php  
PHP Warning:  file_exists(): open_basedir restriction in effect. File(/var/www/html/moodle/admin/cli/../../install/distrolib.php) is not with

in the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps) in /var/www/html/moodle/admin/cli/install.php on line 95
PHP Warning:  file_exists(): open_basedir restriction in effect. File(/var/www/html/moodle/admin/cli/../../config.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps) in /var/www/html/moodle/admin/cli/install.php on line 104
PHP Warning:  chdir(): open_basedir restriction in effect. File(/var/www/html/moodle/admin/cli) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps) in /var/www/html/moodle/admin/cli/install.php on line 124
PHP Warning:  require_once(): open_basedir restriction in effect. File(/var/www/html/moodle/lib/phpminimumversionlib.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps) in /var/www/html/moodle/admin/cli/install.php on line 150

Warning: require_once(): open_basedir restriction in effect. File(/var/www/html/moodl/lib/phpminimumversionlib.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps) in /var/www/html/moodle/admin/cli/install.php on line 150
PHP Warning:  require_once(/var/www/html/moodle/lib/phpminimumversionlib.php): failed to open stream: Operation not permitted in /var/www/html/moodle/admin/cli/install.php on line 150

Warning: require_once(/var/www/html/moodle/lib/phpminimumversionlib.php): failed to open stream: Operation not permitted in /var/www/html/moodle/admin/cli/install.php on line 150
PHP Fatal error:  require_once(): Failed opening required '/var/www/html/moodle/admin/cli/../../lib/phpminimumversionlib.php' (include_path='.:') in /var/www/html/moodle/admin/cli/install.php on line 150

Fatal error: require_once(): Failed opening required '/var/www/html/moodle/admin/cli/../../lib/phpminimumversionlib.php' (include_path='.:') in /var/www/html/moodle/admin/cli/install.php on line 150

[/CODE]

There's a bunch of warnings, but the final error is in so the problem with opening the file 'phpminimumversionlib.php'. This file exists!
[CODE]

$ ls -l /var/www/html/moodle/admin/cli/../../lib/phpminimumversionlib.php

-rwxr-xr-x 1 john john 3157 mar  6 18:03 /var/www/html/moodle/admin/cli/../../lib/phpminimumversionlib.php

[/CODE]

Thanks!



Average of ratings: -
In reply to studyingroup com

Re: Fatal error: require_once(): Failed opening required phpminimumversionlib.php'

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

PHP's open_basedir directive has been configured and does not allow scripts to access the Moodle source code folder.

open_basedir restricts the files that scripts can access to only those folders, in this case: "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps". This includes files that can be loaded with require_once() and, as your Moodle source code folder /var/www/html/moodle is not in the list, the access is blocked.

So you need to add the source code folder to open_basedir, and any other location Moodle will access, certainly Moodledata and optionally any other folder your Moodle is configured to access such as in system paths. If you manage the server then you may find it easier to remove the open_basedir restriction entirely.

In reply to Leon Stringer

Re: Fatal error: require_once(): Failed opening required phpminimumversionlib.php'

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Alternatively you could move the Moodle folders – the source code folder and Moodledata – into one of the folders currently in open_basedir, for example in /srv/http.

In reply to Leon Stringer

Re: Fatal error: require_once(): Failed opening required phpminimumversionlib.php'

by studyingroup com -
SOLVED! In fact it was a problem with my basic php/apache configuration!
I've launched a test phpinfo file and it wasn't working.
I don't get why the errors was all about file permission... Quite misleading