![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mkdir | mirusnet | UNIX for Advanced & Expert Users | 3 | 02-23-2008 05:00 AM |
| mkdir | big123456 | Shell Programming and Scripting | 2 | 07-22-2006 07:23 AM |
| install vs mkdir | thmnetwork | Linux | 1 | 03-30-2005 08:25 PM |
| Can't mkdir in /home | leond | UNIX for Dummies Questions & Answers | 5 | 03-05-2003 07:04 AM |
| mkdir limitations | flignar | UNIX for Dummies Questions & Answers | 12 | 08-30-2002 11:30 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
calling mkdir from PHP (Solved)
Edit: From a post in this topic, found out that my problem wasn't what I thought it was, and ended up solving my problem in aonther topic: http://www.unix.com/showthread.php?p...#post302076761
Hi, I'm not sure if this is a Unix problem or a PHP problem, but I'll see if anyone here knows. So I have a PHP script that calls shell_exec('mkdir thefolder'); - for anyone who doesn't know php, shell_exec just throws a command at the command shell. "thefolder" is able to be created, BUT it is somehow created as read-only. When I click the file in Windows and try to uncheck the read-only, it won't let me. I tried deleting it through Unix, didn't work. The only way I could delete the folder was to use shell_exec('rm thefolder'); in PHP. Now this makes no sense to me, shell_exec is just supposed to send a command to the Shell. calling 'mkdir thefolder' in Unix does not create it as read only, despite being the same command. As well, 'rm thefolder' does not work in the normal Unix, but the PHP script calls it fine. I'm so confused. Any Ideas? Thanks, Graeme Last edited by gmclean2006; 06-15-2006 at 08:29 AM. |
| Forum Sponsor | ||
|
|
|
|||
|
The PHP is running on a Web server (e.g. Apache) with the identity of a special user (e.g. nobody), and it makes sense that only that user on the system is able to remove the directory created by himself. Most Unix Web servers today are installed this way.
|
|
|||
|
Ok thanks, that makes sense.
But I'd assume if I could have it chmod'd so that all users have write access then there wouldn't be a problem? If thats the case then the other thread that i just posted "chmod - "future" changes", if that can get solved, it will probably solve the problem. |
|
|||
|
No, at least on the user (script) level.
However, you can configure Apache to run CGI scripts (recall that PHP scripts may be executed as CGI scripts with PHP CGI executable) in suEXEC mode, which allows scripts to run with the privileges of the script owner instead of the server user. But as I said, few servers I have seen are configured this way with suEXEC. http://httpd.apache.org/docs/2.2/suexec.html |
|||
| Google The UNIX and Linux Forums |