This question already has an answer here:
- PHP mkdir: Permission denied problem 12 answers
I'm trying to create directory on my local apache server with php.
I tried<?php mkdir("folder"); ?>
and<?php exec("sudo mkdir folder"); ?>
When I try to execute them in browser nothing happens.
But I can execute them from terminal by using sudo. (I also modified sudoers file so it won't prompt for password in second code)
When I don't use sudo I get this errorPHP Warning: mkdir(): Permission denied in /var/www/html/mscr/add.php on line 2
I've also tried this and this .
So I can execute almost everything but directory operations in browser. I want to be able to create, delete and edit directories in browser.
Thank you!
</div>