CakePHP – Open_Basedir Restriction in Effect
2nd June, 2008 – 10:37 pmJust deployed a CakePHP on a domain running PLESK and dismayed by the fact that your screen is over-flowing with warning about open_basedir restriction in effect? Fear not, the solution is straight forward (if a little frustrating to track down!)
The problem is caused by this line (line 69, in CakePHP 1.2.0.6311) in /app/webroot/index.php:
Yep, the simple ini_set command – the clues should start coming in thick and fast that ini_set is causing the problem due to the fact taht open_basedir complains about paths with :’s in their structure. (:’s being the delimiter for automatically included paths). To fix the problem you can either remove the if logic that calls “function_exists(’ini_set’)”, or, if you prefer to fix things the corret way, modify the line to remove the final stub:
Good luck, hope that saves someone a headache! :)
4 Responses to “CakePHP – Open_Basedir Restriction in Effect”
That has seriously saved so much time for me – it got rid of all of those errors..but… there’s always a but..
I am getting these errors still..
Warning: fread(): 18 is not a valid stream resource in /home/httpd/vhosts/wayfunky.com/subdomains/crm/httpdocs/cake/libs/file.php on line 170
Warning: fclose(): 18 is not a valid stream resource in /home/httpd/vhosts/wayfunky.com/subdomains/crm/httpdocs/cake/libs/file.php on line 266
Warning: fwrite(): 18 is not a valid stream resource in /home/httpd/vhosts/wayfunky.com/subdomains/crm/httpdocs/cake/libs/file.php on line 236
Warning: fclose(): 18 is not a valid stream resource in /home/httpd/vhosts/wayfunky.com/subdomains/crm/httpdocs/cake/libs/file.php on line 266
Warning (2): fwrite(): 18 is not a valid stream resource [CORE/cake/libs/file.php, line 236]
I am not sure – but I am trying to set up a sub-domain not a primary domain with cake. It’s plesk 7.5.4 that I’m trying to use as well.
Do you think it has anything to do with this? http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/Q_21788041.html?sfQueryTermInfo=1+apach+cgi+httpd.conf+plesk+rail+rubi+vhost
My head is about to explode
By Lloyd on Jun 24, 2008
thx mate, very very useful. Just saved me an aspirine.
By Steven on Oct 31, 2008
Thanks a lot for this tip. I am new to CakePHP and Plesk.
This tip has been of great help for me!
Kind regards, Christine
By Christine Furst on Nov 26, 2008
The fix didn’t work for me, but I am not using Plesk. I have a feeling this is going to waste my whole day.
By Shaun on Sep 26, 2009