I'm trying to create directory on my local apache server with php.
<?php mkdir("folder"); ?>
<?php exec("sudo mkdir folder"); ?>
PHP Warning: mkdir(): Permission denied in /var/www/html/mscr/add.php on line 2
Sounds like Apache doesn't have permission to create the folder. Either given Apache ownership of the folder (where you're trying to create a new one) or set the folder permissions to 777
sudo chmod 777 /var/www/html/mscr
Warning this will make everything within the mscr folder executable. To get around this most CMS will create a subfolder which is set to 777 so something like /var/www/html/mscr/uploads