Check out Dr. Bob's Linux Tutorials, specifically these two: permissions and chmod.
Just for a bit of background which may not be apparent:
Each file (and directory) in linux has an owner (generally the user or process which created the file) a group (such as users) and then "public" access rules.
For each of these three permission categories you can have different settings. The basic settings are "read", "write" and "execute", which allow a particular user to do just that; read, write, or execute the file.
You'll need to set permissions in such a way that PHP, whether as an owner, a group member, or public process has the permission to modify and create certain files in a certain folder.