Forum Moderators: coopster

Message Too Old, No Replies

php.ini safe mode off

         

simonuk

2:23 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



I need to create a php.ini for the server and all I need it to say is safe mode off.

I've had good look through the search engines but I'm struggling to find what I'm looking for.

Can anyone help?

coopster

2:32 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



PHP has some default php.ini examples loaded during install [php.net] which you can copy and manipulate. The installation manual page for PHP is a great starting point and then follow up on your particular platform. There is also a Runtime Configuration link from this page which in turn has a link listing all php directives and where they can be set and overridden.

simonuk

2:46 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



The PhP comes preinstalled on the server and I have no files to reference and no simple examples I can use :(

jatar_k

2:49 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



download php and then take the php.ini from there

simonuk

2:51 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



PHP Version is 5.1.6 if that helps

coopster

2:52 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I get the feeling you did not read the link offered. The page I linked to and the page I referred to, "Runtime Configuration" which is in the navigation menu on the left of the page has a link to the latest php.ini file. The page also instructs you which directives can be edited and where and how you edit them [php.net].

For example, the PHP

safe_mode
directive is of type
PHP_INI_SYSTEM
which means this entry can be set in
php.ini
or
httpd.conf
.

simonuk

3:16 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



Thanks for the link. I did try but I don't understand any of it. I thought this would be like a simple css file where you can strip everything and just have one or two lines for what you want. If I had the time to learn PhP I would and I was hoping one line of code the server wants would have a simple answer :)

The host wants 500 pounds an hour to do it so I guess I go back to them :(

coopster

3:27 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Unfortunately this setting can only be changed in an area that you likely do not have access. Out of curiosity, why do you need it off? I mean, is there a compelling reason that it must be off? I'm asking because perhaps we can help you with a workaround instead.

simonuk

3:32 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



Trying to install x-cart on my server and it says:
Safe Mode is enabled. Safe Mode must be turned off for correct operation of X-Cart application.

I tried the host who said I could upload a php.ini file into the httpdocs folder and this would fix it.

Closest I can get to this is a php.ini file with:

[PHP]

; Safe Mode
;
safe_mode = Off

; End:

coopster

3:36 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



And did that work? Or do you need to upload a more "complete" php.ini file?

simonuk

3:37 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



I don't know if that would work. Can the php.ini be this simple can you see a reason it wouldn't work?

I'm not keen to start messing around unless I know it won't cause other problems.

coopster

3:48 pm on Mar 3, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't know. I have no idea how your hosting provider is set up and how they are incorporating your changes. I'm not familiar with the process they are using, it is new to me and quite frankly I didn't know it was possible. I am trying to figure out how they might be implementing directives in this manner to be quite honest with you.

However, if it is indeed the way you have been instructed to manage php.ini for your own installation then I might take the following approach ...

The Runtime Configuration [php.net] page that I mentioned earlier has a link to » the latest php.ini [cvs.php.net] from CVS. However, as jatar_k mentioned, you may be better off going to the downloads [php.net] page and getting the latest source for your version. Extract that and find the php.ini file in there and use that as your starting point for your "complete" php.ini that you will update and then upload.

The update part I mention here is where you can be smart. A trick here is to run a phpinfo() script first to get the current settings that your hosting provider has running on the box. This way, you can update your php.ini to look exactly like theirs and then make the one change that you want at this point to the

safe_mode
directive. Upload your version to where they have instructed you and you are now where you want to be.

Once again, I have never done this before and as I disclaimed earlier I am not at all familiar with this approach to php.ini file management. You may want to confirm with your hosting provider before following through on this approach.

simonuk

3:59 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



Given your replies the best thing for me to do is mail the host and asked them to supply me the current php.ini file on the server and go from there. At the very least I'll have all the current and correct settings for the server which I should then be able to modify.

Thanks for the help so far, I'll keep you posted!