Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
[PAYH] Can someone explain what the SAFE MODE restrictions are?
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- [PAYH] Can someone explain what the SAFE MODE rest...
[PAYH] Can someone explain what the SAFE MODE restrictions are?
17-01-2009 9:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I keep hitting SAFE MODE permission errors and I wnated to know what exactly are the restrictions in place?
Message 1 of 3
(1,010 Views)
2 REPLIES 2
Re: [PAYH] Can someone explain what the SAFE MODE restrictions are?
18-01-2009 2:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
This describes safe mode http://uk3.php.net/manual/en/ini.sect.safe-mode.php and as far I can tell it means that you can't create a file or directory unless the parent directory is owned by the same user as the user that owns the script - note the owner of the script NOT the user the script is running as.
So if the script is owned by frank it can only create files or directories in a directory owned by frank. If you create a sub-directory it will be owned by the user that the script is running as - www-data NOT frank - so the script can't then create files or sub-directories in the new sub-directory.
So in other words you can't create directory trees using a script running as www-data because the first sub-directory the script creates cannot be written to by the script.
The only way around this would be to make the php owner www-data - which I am not sure you can even do and would be a huge security hole (irony is a wonderful thing).
I may have got that wrong, I am no expert, if so please post a reply.
So if the script is owned by frank it can only create files or directories in a directory owned by frank. If you create a sub-directory it will be owned by the user that the script is running as - www-data NOT frank - so the script can't then create files or sub-directories in the new sub-directory.
So in other words you can't create directory trees using a script running as www-data because the first sub-directory the script creates cannot be written to by the script.
The only way around this would be to make the php owner www-data - which I am not sure you can even do and would be a huge security hole (irony is a wonderful thing).
I may have got that wrong, I am no expert, if so please post a reply.
Message 2 of 3
(324 Views)
Re: [PAYH] Can someone explain what the SAFE MODE restrictions are?
18-01-2009 7:07 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The way to avoid the Catch 22 I have now discovered is to use cgi-php
See this post http://community.plus.net/forum/index.php/topic,73037.0.html
See this post http://community.plus.net/forum/index.php/topic,73037.0.html
Message 3 of 3
(324 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- [PAYH] Can someone explain what the SAFE MODE rest...