Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Oct 2009
    Posts
    32

    Exclamation Allowing Custom PHP.INI files

    Hello,

    I have been playing about with this allday but can't get it working, I have a client that wants to disable register_globals so I told them to create a custom php.ini but they reported its not working so I had a look and it wasnt, I turned it on global and the script worked so its 100% not working with a custom php.ini.

    I have tried nearly everything I have found in forums without any look so I have come to you guys. Is there a setting to allow or disallow them?

    Please let me know what info I need to provide you with to find this problem


    Thank you

  2. #2
    Member
    Join Date
    Oct 2009
    Posts
    32

    Default

    I have found a ton of these questions in this forum and everyone is unanswered...

    My problem is same as this one http://forums.cpanel.net/f5/please-h...ni-101269.html

    thanks

  3. #3
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Quote Originally Posted by martynh View Post
    I have been playing about with this allday but can't get it working, I have a client that wants to disable register_globals so I told them to create a custom php.ini but they reported its not working so I had a look and it wasnt, I turned it on global and the script worked so its 100% not working with a custom php.ini.
    Are you telling me you have "register_globals" turned on globally?

    Bad ... bad idea!

    If anything, you should do it the other way around and have it OFF
    by default for the whole server and only turn it on for those specific accounts that absolutely have to have it and can't find any other solutions.

    Now regarding your custom setting problem, I can help you with that.
    Contact me by private message and I'll help you diagnose what is
    going on and perhaps upgrade things a bit for you.

  4. #4
    Member
    Join Date
    Oct 2009
    Posts
    32

    Default

    Argh... sorry people, I was ment that they want it enabled but I have it disabled globally...

    Thanks!

    I have sent you a message.

  5. #5
    Member linux7802's Avatar
    Join Date
    Dec 2007
    Posts
    224
    cPanel/Enkompass Access Level

    Root Administrator

    Default Solution

    Quote Originally Posted by martynh View Post
    Hello,

    I have been playing about with this allday but can't get it working, I have a client that wants to disable register_globals so I told them to create a custom php.ini but they reported its not working so I had a look and it wasnt, I turned it on global and the script worked so its 100% not working with a custom php.ini.

    I have tried nearly everything I have found in forums without any look so I have come to you guys. Is there a setting to allow or disallow them?

    Please let me know what info I need to provide you with to find this problem


    Thank you
    As per query it seems to be that you are confuse with SuExec server.The custom php.ini concept is working on only SuExec enabled server.First you need to confirm that your server is SuExec or not? refer following thread and check whether your server is SuExec or not?

    Simply check server is SuExec or not? | Linux Servers cPanel webhosting blog

    Once you confirm it that your server is SuExec then please copy and paste the php.ini file in each an every folder where you want to disable register_globals for your domain.

    Note : On SuExec server php.ini file is working directory base due to that you need to add/copy php.ini in each directory where you want to change php values for your domain.
    Regards,
    G R Sonar
    cPanel Hosting Blog

  6. #6
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    It seems that you did not place the custom php.ini file in the required folder. The custom php.ini needs to be there in each and every folder(and sub-folder) where you need the change to take effect.

    For example, if you have a directory named 'abc' under your public_html and this is where you need the change then place the custom php.ini in that folder.
    Also, to check whether the change is actually taking effect, create another file named 'phpinfo.php' in the same directory and put the following line in it :

    Code:
    <? phpinfo();
    ?>
    Now, access the URL http://yourdomainname.tld/abc/phpinfo.php to see whether the new settings are active.

    Note: Replace 'yourdomainname.tld' with your domain name.

  7. #7
    Member
    Join Date
    Oct 2009
    Posts
    32

    Default

    Sorry for the delay...

    Yes SuExec was enabled but it just was not working, I followed some forums about putting them in every folder then I tried going back to dso for .htaccess which did work but I got told that is is a bad way to do it...

    In the end Spiral had a go and did some modifacations for me which allows me to enable it for them on request per account...

    He did say that there were alsorts missing from my cPanel installation which maybe why it was not doing what its supposed to do...

    Thanks all all your help, while Spirals way works now, when I get my next server I may need to follow your intructions so will write them down

    Thanks
    Martyn

  8. #8
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    InstaCarma_Tech, if you setup custom PHP.INI files the way you describe, all hosting users will have unlimited, unbound, and unrestricted control over your entire PHP system configuration without limits and can do pretty much anything they want unchecked which would actually put you in a worse situation that just keeping insecure Apache Module (DSO) PHP!

    There is a few ways to get around this problem and still allow for custom configurations of each site left under administrator control.

    I have setup martynh such that their server can have a different configuration for each and every account easily and under administrator control without additionally compromising security.

Similar Threads & Tags
Similar threads

  1. Custom php.ini
    By rahuldas14 in forum New User Questions
    Replies: 1
    Last Post: 06-06-2011, 05:55 AM
  2. php-fcgid+eaccelerator+custom php.ini+apache2-mpm-worker= segfault?
    By internetfab in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-30-2011, 04:25 PM
  3. Help with custom php.ini
    By richirich in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-07-2010, 05:40 PM
  4. custom php.ini with php handler set as cgi
    By johny_gjx in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-16-2009, 03:54 AM
  5. Custom php.ini files?
    By ehuk in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-12-2008, 02:15 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube