Page 1 of 1
SAFE MODE Restriction in effect
Posted: Thu Sep 21, 2006 10:10 am
by tristan
Hi there,
I get the following error with the latest CMSMS (1.0.2) if I try to install a modules with the Module Manager, if I click Download & Install:
Code: Select all
Warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is 538 is not allowed to access /tmp/modmgr_xLS9sI owned by uid 100 in /home/username/domains/domain.coml/public_html/test/en/modules/ModuleManager/ModuleManager.module.php on line 922
Warning: fopen(/tmp/modmgr_xLS9sI) [function.fopen]: failed to open stream: Permission denied in /home/username/domains/domain.com/public_html/test/en/modules/ModuleManager/ModuleManager.module.php on line 922
Error!
Checksum error. This probably indicates a corrupt file, either when it was uploaded to the repository, or a problem in transit down to your machine.
expected: a41489c63827f8d18ef9e35f5ec943d4 and got d41d8cd98f00b204e9800998ecf8427e
Any idea how to fix this? The modules dir is chmodded 777 so I guess this is a problem about ownership of files in the /tmp folder and the actual modules dir owner.
Re: SAFE MODE Restriction in effect
Posted: Thu Sep 21, 2006 10:57 am
by tristan
Owh and if I try the old fashioned way by uploading an xml on the modules section I get:
Code: Select all
Could not create a file (permissions problem?) /home/username/domains/domain.com/public_html/test/en/modules/FeedbackForm/templates/AdminMain.tpl (Troubleshooting)
However there is a new dir in my modules dir for the new module, not a single file in it though.
Re: SAFE MODE Restriction in effect
Posted: Fri Sep 22, 2006 2:41 pm
by tristan
Does anyone have a clue? If you have tips or anything I can try please let me know!
Re: SAFE MODE Restriction in effect
Posted: Fri Sep 22, 2006 5:05 pm
by tsw
your server is configured with safe mode php which disableds scripts from accessing files which are owned by other users.
I dont quite understand why that downloaded file is not owned by your php script though.
you can try installing modules from shell by uploading tar.gz package to modules dir and extracting it
hope this helps
Re: SAFE MODE Restriction in effect
Posted: Fri Sep 22, 2006 5:19 pm
by tristan
Thanks for your reply, but safe mode is actually switched of. The downloaded files are probably owned by the webserver itself, that's why the new folder in modules is by the apache user and group.
About the tar.gz thing, nowadays modules are only in xml format, so how would I extract those?
Re: SAFE MODE Restriction in effect
Posted: Fri Sep 22, 2006 5:36 pm
by tsw
"SAFE MODE Restriction in effect"
in your error message suggests that safe mode is on
Re: SAFE MODE Restriction in effect
Posted: Tue Sep 26, 2006 8:34 am
by tristan
Yes that's correct, my mistake, forgot to restart Apache. But would there be a way to make this work without the php safe mode being off?
Re: SAFE MODE Restriction in effect
Posted: Sun Apr 01, 2007 7:23 pm
by calguy1000
Here's a quote from
http://ca.php.net/features.safe-mode
When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function or its directory.
So then, if you installed CMS via FTP, it (index.php) and the modules directory are owned by your FTP owner (let's call it "ftp"), the apache process is running as user "apache".
Uploading a module via xml will first create a directory in the modules directory, and it will succeed, because the modules directory, and the script (index.php) are owned by the same user. The directory will be created with ownership "apache". the next step is to create a file in that directory, and that will fail.. This is because the directory just created is owned by "apache", and the owner of the current script (index.php) is "ftp".
And this is ontop of any other permissions problems that may be getting in the way.
Unfortunately, if safe mode is in effect, you're going to have grief. Especially in a hosted environment.
Re: SAFE MODE Restriction in effect
Posted: Fri Apr 27, 2007 1:37 am
by Sausage
If you wont to turn Safe mode of you
Mostly you can edit this from ftp found in CGI-BIN directory
i uses SMART FTP as ftp browser.
Found PHP.INI open it and ad this line to it.
safe_mode = off
i added this to
register_globals = off
memory_limit = 50M
php_admin_value memory_limit = 50M
file_uploads = On
upload_max_filesize = 200M
max_execution_time = 600
max_input_time = 600
post_max_size = 200M