Reputation: 105
I'm trying to create a directory with a perl script after calling it via Ajax through a web interface. I'm using IIS7.5 to run my webserver.
The problem arises when I use either mkdir($path)
or system("mkdir", $path)
, with the errors being "Permission denied" or "Access is denied", respectively. I believe I've set up the permissions correctly to give read/write/execute permissions as well as special permissions to create files and folders to the script.
Please let me know also if this should should be posted elsewhere, thanks!
Upvotes: 2
Views: 3181
Reputation: 1149
Please keep in mind that , the folder that you are planning to create this new folder in , must be owned by apache ( or any other web server software, you might be using ).
sudo chown apache *rootfolderfornewfolder*
I hope this helps
Upvotes: 0
Reputation: 377
I would think you could find the user running the script with "whoami".
Also, I'm not clear on what context the script is running in, nor where is the directory it is trying to create. It might be necessary to add the "-p" option so that necessary parent directories are created.
No comment on the safety of this ... I assume that those checks are being made elsewhere.
Upvotes: 1