You are viewing the PKP Support Forum | PKP Home Wiki

Upload problem. Safe mode

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Upload problem. Safe mode

Postby maocas » Thu May 04, 2006 2:32 pm

I have instaled OJS in a ISP server successfully and it seemed to work correctly, but....i have problems with the upload files. Uploading articles, logos, or any other file takes place an error of the type:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 631 is not allowed to access /home/moc22e/domains/tonosdigital.com/public_html/ojs/ficheros/journals/4/articles/2 owned by uid 48 in /home/moc22e/domains/tonosdigital.com/public_html/ojs/classes/file/FileManager.inc.php on line 234

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 631 is not allowed to access /home/moc22e/domains/tonosdigital.com/public_html/ojs/ficheros/journals/4/articles/2 owned by uid 48 in /home/moc22e/domains/tonosdigital.com/public_html/ojs/classes/file/FileManager.inc.php on line 95


The SAFE MODE is ON and so the GID of the created files/folders by OJS is "apache" while the GID of the rest of the files is "myuser". I think that it is what causes that the error appears.
The ISP said that cannot set the safe mode to off due to its security policy.
They have modified all uid/gid to set "myuser/myuser" for all files and it solve the problem termporaly. When a new file is upload the problem appears again (for the file or its folder with owner:apache group:apache).

it is possible to solve this problem or OJS is incompatible with Safe mode on

Thanks for the help.

M.A. Olmedo
Posts: 1
Joined: Thu May 04, 2006 1:46 pm

Postby asmecher » Thu May 04, 2006 3:08 pm

Hi maocas,

There's a bit of discussion of this at http://ca.php.net/manual/en/features.safe-mode.php#45917; there is a possible solution at http://ca.php.net/manual/en/features.safe-mode.php#55581.

Another solution would be to see if your ISP will consider enabling the safe_mode_gid option, which will relax the UID-based ownership check to a GID (group ID) check. If your user is then placed in a group with the web server user (e.g. apache) and file permissions are properly set in your OJS files directory, it'll work.

Alec Smecher
Open Journal Systems Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 6 guests