It's that dreaded error again.

I've read most of the posts already made, but I still haven't been able to resolve the issue.

I've got an Image Upload script, and when trying to upload the image, I get the error:

Warning: SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access /la/la/ala/path owned by uid 48 in /home/virtual/site1/category.inc.php on line 119

I can't disable SAFE MODE - so is there a work around to this? Surely there's a work around?

I'd really be grateful for any help as I've got to have this assignment handed in by the end of the week.

Thanks.

    perhaps you should try chmod to the folder where you are trying to upload the image to, and don't forget to chmod the uploaded file also, it won't be shown otherwise.

      Yep, the directory is chmod'd to 777.

      I don't even get a chance to CHMOD the image as the SAFE Mode is stopping me from uploading it at all.

      This is soooo irritating as I don't get the error on Windows server - only Linux 🙁

        wincrap doesn't care about UID's 🙂
        ... but sorry, i can't help if it isn't that 🙁 ... perhaps you should ask the server admin about any workaround or him changing the php.ini 🙂

        ini_set("safe_mode", "0") won't work also, i think, but perhaps you can try before asking the admin 🙂

        good luck 🙂
        axo

          Thanks axo for trying.

          I can't believe someone hasn't figured how to resolve this especially since this is the default setup for PHP.

          If anyone else could help - I'd be so grateful.

            ok, I just checked out the PHP.ini file

            Safe Mode is OFF!!!

            So I wasn't too sure why wasn't working.

            I did a phpinfo() and:

            safe_mode
            Local Value: On
            Master Value: Off

            safe_mode_gid
            Local Value: Off
            Master Value: Off

            Where the hell is the "Local Value" specified? Because wherever it is - I need to find it and disable safe mode.

            If anyone knows where - please, I'm desperate!

              PROBLEM SOLVED!!

              Apache had a line of code in httpd.conf that enabled Safe Mode although php.ini was disabling it.

              If you find the httpd.conf file for Apache, you can disable Safe Mode.

              My script now runs fine.

                Write a Reply...