PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm having problems implementing a simple upload script which creates a directory and uploads images to that folder. mkdir() works but the uid and gid are owned by apache. As a result the newly created folder cannot be accessed. I have scowered the internet for documentation on this subject but to no avail.
My code is more complicated but for the purpose of testing I have created a very simple page with code as follows:
Like I said in the above post the the uid and gid are apache. As such, nothing can be used to change the permissions including php, plesk and ftp. The only option I have with the newly created folder is to delete it.
The 'apache' user created the directory, so it will definitely have the access rights necessary to allow you to run chmod() - the PHP function chmod(), not the shell executable. Change it so the world can access it & you should be good to go.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.