After some installation problems related to the RedHat php.cgi binary, I finally got Gallery installed and configured. However, when I try to create my first album, I get this message:
Warning: SAFE MODE Restriction in effect. The script whose uid is 10029 is not allowed to access /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/albums/album01 owned by uid 2526 in /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/platform/fs_unix.php on line 53
Warning: fopen("/usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/albums/album01/album.dat.lock", "a+") - No such file or directory in /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/platform/fs_unix.php on line 53
Error: Could not open lock file (/usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/albums/album01/album.dat.lock)!
Warning: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/platform/fs_unix.php:53) in /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/do_command.php on line 137
Looking at the directory listing, when the server makes the Album01 directory, it is owned by user=apache group=apache. Also the userdb files get changed to apache - they were owned by me before I tried to create an album. I'm on a shared host with no shell access. I suppose I need to talk to the webhost, but I'd like to know what to tell them. Anybody able to help? The (empty) gallery is <!-- BBCode Start --><A HREF="http://www.ochsenhirt.com/html/modules/gallery" TARGET="_blank">here</A><!-- BBCode End -->. Help would be greatly appreciated. Thanks.
Posts: 120
First thing first, make sure SAFE MODE is OFF. Let me know.
Posts: 5
Depends on how you define it. Safe Mode is on at the server level, which is why I installed the php.cgi binary. Gallery setup then says safe mode is off, and allows me to proceed. phpinfo.php run from the setup directory still says safe mode is on, but wouldn't that be the case?
Posts: 7994
If you're running PHP as CGI then you shouldn't have safe mode on at the master level, unless you yourself put it in the php.ini that your CGI binary is accessing.
I would spend a little more time and be sure that you're successfully using the CGI binary. It's easy to make a small mistake and wind up continuing to use the server mod.
EITHER WAY, when you see "Warning: SAFE MODE Restriction in effect" you can be sure that Safe mode is, in fact, turned on. It's a matter of us figuring out what went wrong in your config :smile:
It'd help greatly if we could see the results of your phpinfo() on your server, both in your gallery dir and in your gallery/setup dir.
Posts: 5
All right, so what appeared to happen is the .htaccess file got replaced/rewritten with a blank file, so it wasn't using the cgi. I replaced the .htaccess file, and get this error when I go to my gallery directory:
Warning: open(/tmp/sess_2efc59b4603f2b03d9baf998ba3121eb, O_RDWR) failed: Permission denied (13) in /usr/local/psa/home/vhosts/ochsenhirt.com/httpdocs/html/modules/gallery/session.php on line 51
Posts: 120
To troubleshoot this problem, assign permission 777 and try it again. It will provide you any error, if you still have something to resolve.
Posts: 5
I'm guessing that the problem relates to the session.save_path variable in php.ini. phpinfo.php reports that it is set to /tmp, which I can't change the permissions of. If I don't use php.cgi, I can change that variable through a php_info line in .htaccess. If I use the cgi, it has no effect. I'm way in over my head here.
Posts: 7994
It's a little whacked that you can't write in /tmp -- but then again there are all kinds of ISP configurations out there.
You can try adding:
ini_set("session.save_path", "/path/to/some/writeable/dir");
in session.php above the session_start() line and see if that works
for you.
Posts: 5
Awesome. It worked. My hosting company is a pain in the a**, but they do give me 1000 MB for 10 bucks a month. When I asked them if they would disable safe mode for one directory (with other appropriate security precautions) they told me that I needed to learn to write my scripts to work with safe mode on. :evil: