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 |
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
Thank you for the reply Howard. where would i go in the php.ini file to turn off the restriction?
The line that starts 'open_basedir' (check the documentation page I linked to)
Don't forget to edit the right php.ini file and to restart the web server if you change anything.
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?
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.
If you are modifying Moodle core code to make it work then you are doing it wrong. That's *never* the solution.
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.