So I am trying to get PHP save error logs automatically to the directory where the script containing error is. But the problem is that error logs are not written unless I set permission 777 to all directories manually. And that is something I wouldn’t want to do due to security issues.
So I tried this
chgrp www-data /var/www chmod g+w /var/www
But, unfortunately, it didn’t help. Any other advice?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
This question was answered by @ryanpq:
View the original comment
This is quite old question, but asking here anyway since it’s strongly related. So the problem is that I need to use above command (
chown -Rf www-data:www-data /var/www) every time after creating a new directory. Is it possible to make new directories automatically get the same ownership as the parent directory so that I wouldn’t need to manually run the command?
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now