I've implemented a simple caching system that loads a static HTML if the database says no updates are available, and re-generates/writes the file when the database says there is an update.
Initial tests suggest that this works, however, the actual writing of the file does not operate:
Warning: fopen(/var/www/html/cache/en/item_4.php):
failed to open stream: Permission denied
The php script that attempts to write said file is located at /var/www/html/src/p/view_item.php
Every solution thus far assumes that I know how to fully operate the server and uses complicated terminology and reasoning; this is my first go with my own server, several things still aren't clear.
I've seen it said on multiple occasions that you should give the the user "nobody" write access to said folder (On a fresh PHP installation), while others say the file itself need some form of ownership over the directory or Apache itself needs write access.
Overall: Nothing's worked, ranging setting the directory to 777 and running the operation as another user (Whom I can only assume has write access there, too).
How exactly can I allow PHP to write to /var/www/html/cache/en/
and sub-folders?
I'm running LAMP, I have shell access and all that.