How to change a host setting, Custom php.ini?

Discussion in 'PHP' started by adamjblakey, Jun 13, 2007.

  1. #1
    Hi,

    I need to change safe_mode to off and my host will not do it for obvious reasons. But i have been reading that i can use a custom php.ini file to resolve this?

    Can anyone shed some light on how i would go about doing this?

    Cheers,
    Adam
     
    adamjblakey, Jun 13, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    http://php.net is your friend and knows far more than anyone you find on forums

    http://uk2.php.net/safe_mode

    In the first table it quite clearly states that safe_mode is only changable by PHP_INI_SYSTEM, settings that can be changed from any php.ini will have the flag PHP_INI_ALL or similar.......if you could change it, it would void the safe mode feature entirely.

    What exactly do you need safemode disabled for ??

    Perhaps there is a code workaround ???
     
    krakjoe, Jun 13, 2007 IP
  3. adamjblakey

    adamjblakey Active Member

    Messages:
    1,121
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Thank you for your fast reply.

    I bought a stock image script from http://www.easyphotostore.com which when i installed had some errors see here: www.wishbank.co.uk i went back to the company i bought from and they said that i need safe mode off? Which i thought was weird but obviously the hosting company will not turn off so i don't know what to do now.

    Cheers,
    Adam
     
    adamjblakey, Jun 13, 2007 IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    send me the code, I'll make it work and send it back, or send me a login and I'll do the same .....

    the writers are being lazy, they should work around every feature of php and safe_mode is commonly used in thier target environment, you should let me fix it and embarras them by sending it back - ppl hate to have thier jobs done for them, even those too lazy to do thier own jobs in the first place....

    without looking comment out line 4 and chmod /home/wishbank/public_html/templates_c to 777
     
    krakjoe, Jun 13, 2007 IP
  5. adamjblakey

    adamjblakey Active Member

    Messages:
    1,121
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Sounds like a plans, thanks a lot joe :)

    PM Sent.
     
    adamjblakey, Jun 13, 2007 IP
  6. DopeDomains

    DopeDomains Guest

    Messages:
    207
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    TO answer the original question.. You need to:
    1) find the system php.ini script. Easiest way is to use phpInfo(); part of the information will be the location of the INI script.
    2) Copy it into your script root for this script.
    3) Edit the File, change register globals to "on"
    4) Save and copy the php.ini file to EVER directory that's going to be running php for this script.


    No, It's not a good idea, but sometimes it has to be done to get stuff working.

    -JasonR
     
    DopeDomains, Jun 13, 2007 IP
  7. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #7
    Safe mode CANNOT be affected by any php.ini except the system one, it doesn't matter what you put in your working directory it will be ignored or cause 500 errors
     
    krakjoe, Jun 13, 2007 IP
  8. DopeDomains

    DopeDomains Guest

    Messages:
    207
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #8
    That is simply not true. PHP can be configured to allow or dissallow such overrides, but I know for a fact IT can be overridden to allow register globals unless PHP is specifically configured to dissallow the setting to be changed.

    If you would like to see an example let me know I'll set up a phpInfo page that shows the system setting, and the local setting.

    It is important to note that the custom php.ini must be in EVERY directory that you want it to take effect for. It does not cover subdirectories.

    -JasonR
     
    DopeDomains, Jun 14, 2007 IP
  9. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #9
    Dude, read the post properly, we're not even talking about register_globals, we're talking about safe_mode .....

    I certainly don't need to see any examples, lol .......
     
    krakjoe, Jun 14, 2007 IP