Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jan 2007
    Posts
    32

    Default php.ini disable_functions request

    In WHM -->
    Service Configuration -->
    PHP Configuration Editor -->
    Switch to Advanced Mode -->

    Under disable_functions, I would like to know if I can remove phpinfo from 1 domain on my server. I have tried to do this in .htaccess but I keep coming-up with a 500 error. I do not want to remove phpinfo for this setting, just the one website.

    disable_functions = "show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open"

    Thanks for your help,

    Scott

  2. #2
    Member
    Join Date
    Jun 2009
    Posts
    10

    Default

    You can add this by creating a file named php.ini in the document root of the account.

    The content of the file will be:

    disable_functions = "show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open"

    But this will work if the php is compiled as CGI, if not it will give 500 internal server error.

  3. #3
    Member
    Join Date
    Jan 2007
    Posts
    32

    Default Yep, 500 Internal Server Error

    It was NOT complied as CGI. Can I recompile it without causing any problems with my already existing accounts?

    Scott
    Last edited by partsace; 06-20-2009 at 10:30 AM.

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    25

    Default

    Read the PHP manual....

    disable_functions string
    This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode. This directive must be set in php.ini For example, you cannot set this in httpd.conf.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    Default php with the CGI

    Hello,
    You can compile php with the CGI by using WHM -->
    Service Configuration --> Configure PHP and SuExec -->Apache Configuration -->PHP and SuExec Configuration.
    Some time some php script affect after that setting but you can easily solve that problem.

  6. #6
    Member
    Join Date
    Apr 2006
    Posts
    25

    Default

    That will work. I would just be careful. When you do that A user can then override anthing with a custom php.ini I think the only thing they can't override is enabling the exec function.

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

    Default

    Quote Originally Posted by krizag View Post
    You can add this by creating a file named php.ini in the document root of the account.
    Krizag, you can't say this without knowing how the poster's PHP is configured ...

    What you describe is the method to set custom PHP settings for an account
    if the PHP on the system is setup as the old phpSuExec.

    Under DSO (Apache Module) based DSO, settings could be changed for
    an individual site view the main httpd.conf (for restricted settings) or
    from a .htaccess file in the users account (for general settings).

    Under SuPHP, you would need to add a custom PHP directive to the
    user's virtualhost configuration in httpd.conf that points to another PHP.INI
    file that you have setup somewhere else on the system.

Similar Threads & Tags
Similar threads

  1. Individual php.ini files for PHP FCGI and PHP CGI
    By Miraenda in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-22-2011, 09:55 AM
  2. php.ini and override default php.ini
    By areh in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 08-24-2009, 06:45 PM
  3. Question about PHP security, setting up multiple php.ini files?
    By sirbrent in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-01-2008, 11:58 AM
  4. php safe mode on or disable_functions screwing up fantastico
    By bsasninja in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 09-12-2006, 12:16 PM
  5. What is the right way for PHP disable_functions ?
    By docenta in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-19-2006, 04:04 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube