installing moodle 3.1.2 with plesk panels on windows

installing moodle 3.1.2 with plesk panels on windows

by wally rohde -
Number of replies: 7
After following the plesk panels application to install moodle 3.1.2 i get this error in my log files.

PHP Warning: is_readable(): open_basedir restriction in effect. File(/db/renamedclasses.php) is not within the allowed path(s): (C:/Inetpub/vhosts/labar-card.com\;C:\Windows\Temp\) in C:\Inetpub\vhosts\labar-card.com\httpdocs\moodle\lib\classes\component.php on line 1226


Average of ratings: -
In reply to wally rohde

Re: installing moodle 3.1.2 with plesk panels on windows

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

What it says.... "open_basedir restriction is in effect".

'open_basedir' is an optional PHP restriction to only allow scripts to read/write from/to specified parts of the filesystem. That means your Moodle data files *have* to be within the specified directories. The error message even tells you what the allowed directories are - they are set in your php.ini file. 

If you don't really need this restriction I would turn it off. 

Further reading... http://php.net/manual/en/ini.core.php#ini.open-basedir

In reply to Howard Miller

Re: installing moodle 3.1.2 with plesk panels on windows

by wally rohde -

Thank you for the reply Howard. where would i go in the php.ini file to turn off the restriction?

In reply to wally rohde

Re: installing moodle 3.1.2 with plesk panels on windows

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The line that starts 'open_basedir' (check the documentation page I linked to) wink

Don't forget to edit the right php.ini file and to restart the web server if you change anything.

In reply to Howard Miller

Re: installing moodle 3.1.2 with plesk panels on windows

by wally rohde -

Just so i am reading it right. Php doesn't have access to the File(/db/renamedclasses.php). If i grant access to the file it should work properly?

In reply to wally rohde

Re: installing moodle 3.1.2 with plesk panels on windows

by wally rohde -

Ok after doing some simple research i was looking into this way to much. When plesk panels installs the moodle you have to modify the moodle\lib\classes\component.php on line 1226 file where it points to the db renameclass.php by adding ..\before the file name. It was searching for the file in the wrong folder and had to up a level.

In reply to wally rohde

Re: installing moodle 3.1.2 with plesk panels on windows

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you are modifying Moodle core code to make it work then you are doing it wrong. That's *never* the solution. 

In reply to Howard Miller

Re: installing moodle 3.1.2 with plesk panels on windows

by wally rohde -

This is line 1225 of componet.php that is giving the error.

$file = $fulldir . 'db/renamedclasses.php';

The location of the renamedclasses.php is one folder up. so i changed the code to this 

$file = $fulldir . '../db/renamedclasses.php';


Once that change was made moodle was able to find the php file and the error went away.