Reputation: 2358
I'm using the Yii framework for a web app. I moved the runtime folder out of the protected folder and put it on the same level as the index.php file. Now in the main config file, main.php I added:
'runtimePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'runtime',
which is right underneath the basePath that is set correctly:
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
I made sure the runtime folder is writable. I'm using Godaddy with a Windows IIS7 server. This is the error I get: Application runtime path "D:\Hosting\9434915\html\yii\picbridge\protected\config..\runtime" is not valid. Please make sure it is a directory writable by the Web server process.
I know its pointing to the wrong folder but how do I get it to point to the right folder? I used the same file path convention for runtimePath as for basePath.
Upvotes: 0
Views: 7444
Reputation: 2358
I found a solution to my problem I switched from a Windows hosting plan to a Linux. Right after I switched I used FileZilla to set folder permissons and the error went away. I think the problem had to do with the limited ability a user can set folder permissions in a Godaddy Windows shared hosting plan. A user can only set permissions using Godaddy's FTP File Manager, they can't set permissions using FileZilla like in a Linux shared hosting plan.
Upvotes: 0
Reputation:
You are missing slash after ..
.
Notice path in your error message, it is folder config..
and then slash:
D:\Hosting\9434915\html\yii\picbridge\protected\config..
\runtime
Should be:
D:\Hosting\9434915\html\yii\picbridge\protected\config\..
\runtime
What is weird here, is that you have DIRECTORY_SEPARATOR
after dirname(__FILE__)
, and it should produce proper path.
Hint: No need for DIRECTORY_SEPARATOR
, just use /
will work on any windows without problem, this is only usefull for parsing paths from filesystem.
Hint2: Thanks for Eirik Hoem comment, you should strictly separate protected files from public files. Personally i use folowwing layout:
/app/protected/
/app/www/
/framework/
Upvotes: 2
Reputation: 1033
you should not put it in the index.php level, leave it in protected folder.
and within protected folder, use .htaccess
with deny from all
to prevent direct access to your mvc style php code
which is not traditional html output php code
.
check application base directory for detail
Upvotes: 1