SAFE MODE Restriction in effect

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
tristan
Dev Team Member
Dev Team Member
Posts: 375
Joined: Tue May 02, 2006 10:58 am

SAFE MODE Restriction in effect

Post 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.
Last edited by tristan on Fri Sep 29, 2006 10:13 pm, edited 1 time in total.
tristan
Dev Team Member
Dev Team Member
Posts: 375
Joined: Tue May 02, 2006 10:58 am

Re: SAFE MODE Restriction in effect

Post 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.
Last edited by tristan on Fri Sep 29, 2006 10:13 pm, edited 1 time in total.
tristan
Dev Team Member
Dev Team Member
Posts: 375
Joined: Tue May 02, 2006 10:58 am

Re: SAFE MODE Restriction in effect

Post by tristan »

Does anyone have a clue? If you have tips or anything I can try please let me know!
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: SAFE MODE Restriction in effect

Post 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
tristan
Dev Team Member
Dev Team Member
Posts: 375
Joined: Tue May 02, 2006 10:58 am

Re: SAFE MODE Restriction in effect

Post 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?
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: SAFE MODE Restriction in effect

Post by tsw »

"SAFE MODE Restriction in effect"

in your error message suggests that safe mode is on
tristan
Dev Team Member
Dev Team Member
Posts: 375
Joined: Tue May 02, 2006 10:58 am

Re: SAFE MODE Restriction in effect

Post 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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: SAFE MODE Restriction in effect

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Sausage

Re: SAFE MODE Restriction in effect

Post 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
Post Reply

Return to “CMSMS Core”