Hello,

I'm on Linux 10 and none of the file functions work in PhP. I get a permission denied error although I've even chmod the files and directories to 777. I was doing some research on this this and someone had the same problem in a Fedora box. It turned out to be a SElinux issue. Could there be anything in my SuSe that's similar to SElinux?

I'm not a Linux guru but when it comes to finding answers to problems I'm happy to experiment and learn 😉

Regards,
Ernest

    Does the user running as the webserver (I'm assuming you're running it through a webserver) have permissions on the entire path of the file? By this I mean, does the user have permissions on the file and every one of it's parent directories?

      Does the user running as the webserver (I'm assuming you're running it through a webserver) have permissions on the entire path of the file?

      Ok, you have now exposed my Linux weaknesses 😉 I have no idea. How can I tell? I'm assuming the webserver process is called httpd2 or apache2. Which is which? And where can I learn more about this thing?

      Thanks,
      Ernest

        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.

          Thanks banzaimonkey. I shall read up on this stuff. I know it's fundamental to working effectively in Linux but it still eludes me 😉

            Write a Reply...