Reputation: 9183
(Linux CentOS 7) I have installed Zend Serve 8. When I want to visit a project (for now it is OpenCart, but I also tested it with Laravel), it throws error that Permission is Denied for some file (does not allow it to write). Here is the error:
Warning: mkdir(): Permission denied in /var/www/html/project/dir/install.php on line 26
But there are some other error exactly like the above error with the only difference in function (file_put_contents()
). What should I do? Is ZendServer
denied or PHP
?
Upvotes: 0
Views: 630
Reputation: 22770
You need to set the permissions level on the directory you are wanting PHP to work on. Open your directory in SFTP or whatever and change it's permissions to Owner Read,Write,Execute and Group Read,Write,Execute and others, just Read - summarised as setting it to 774. This may not be the best - most secure setup (I'm sorry I'm not more expert on this exact topic), but it works for me. It is because the folder is not created by PHP and when it was created it was set to not allow others to save and write to it.
Displayed:
Read | Write | Execute
Owner X X X
Group X X X <-- see *
Others X
Also seen as #774
.
Edit:
Important: Make the changes recursive!
Upvotes: 3