I was facing "php mkdir permission denied" issue on Ubuntu and Linux (Ubuntu-Centos-Fedora-Debian) during my project setup with Yii Framework
Failed to create directory "/var/www/html/backend/runtime/logs": mkdir(): Permission denied
Following are the permission example I have given to the directories.
- $ sudo mkdir /var/www/html/backend/runtime/logs
- $ sudo chmod -R 777 /var/www/html/backend/runtime/logs
- $ sudo mkdir /var/www/html/backend/runtime/cache
- $ sudo chmod -R 777 /var/www/html/backend/runtime/cache
Now "Failed to create directory permission denied" Issue has been resolved for me!