Safe mode effecting mkdir()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Safe mode effecting mkdir()

Post by HiddenS3crets »

I am trying to use the mkdir() function, but am getting safe mode restrictions.

I have tried changing the values for safe_mode and safe_mode_gid in the php.ini file, but I still get the same error:

Code: Select all

Warning: mkdir(): SAFE MODE Restriction in effect
Any ideas on how to get around this (besides making a directory the FTP way)?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Safe mode effecting mkdir()

Post by Chris Corbyn »

HiddenS3crets wrote:I am trying to use the mkdir() function, but am getting safe mode restrictions.

I have tried changing the values for safe_mode and safe_mode_gid in the php.ini file, but I still get the same error:

Code: Select all

Warning: mkdir(): SAFE MODE Restriction in effect
Any ideas on how to get around this (besides making a directory the FTP way)?
Did you restart the webserver after editting the ini? (Unless you're using CGI).
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Post by HiddenS3crets »

I can't restart the webserver, I don't host my own site.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

HiddenS3crets wrote:I can't restart the webserver, I don't host my own site.
How did you edit the ini file? If you don't own the server and can't do things like restarting it then you shouldn't have access to write to this file. When I say restart the server I mean the daemon, not the hardware ;)
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Post by HiddenS3crets »

I have access to the files, but I don't have Apache running on my own computer or anything so I'm not running my own server. I don't have the capabilities to restart anything
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

HiddenS3crets wrote:I have access to the files, but I don't have Apache running on my own computer or anything so I'm not running my own server. I don't have the capabilities to restart anything
I'm not sure I'm following you :(

Apache runs on the server, it is only configured on the server. PHP runs on the server, and again is only configured on the server. Editting ini files on your own PC will make no difference to how PHP runs on the server. Did you edit the ini on the server or your PC? The only way you can edit the ini without restarting the server is if PHP is configured to run as CGI too... if PHP is running as a module then you're stuck if you can't restart the service.

You should probably speak to your host.
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Post by HiddenS3crets »

I don't run my own server. I get webhosting and the server is running somewhere in Connecticut, but I still have access to the php.ini file. Everything runs on my host's servers, I just access the files through a web browser by logging into the hosting panel 8O
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

there should certainly be a way to restart your server on your control panel if you have the ability to edit your conf files
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

dull1554 wrote:there should certainly be a way to restart your server on your control panel if you have the ability to edit your conf files
I'm not so sure, it sounds like a nifty CGI setup on a shared server with suexec and the php.ini dir specified under apache on a per-directory basis. If it's CGI the ini is parsed at runtime not load-time.

Best thing to do is to change something blatant and run phpinfo(). That's of course after contacting your host to check how it's supposed to work ;)
Post Reply