The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php.ini file upload change - server wide?

Discussion in 'General Discussion' started by tomp66, May 25, 2007.

  1. tomp66

    tomp66 Member

    Joined:
    May 18, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London UK
    need to change the allowed php upload file size (from 2mb default to 30Mb) - which php.ini file should i change or more than one? seems theres a few on our box!

    root@lofly-ds [~]# locate php.ini
    /home/installd/buildapache/php-4.4.6/php.ini-dist
    /home/installd/buildapache/php-4.4.6/php.ini-recommended
    /scripts/php.ini
    /usr/lib/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini
    /usr/local/cpanel/3rdparty/lib/php.ini
    /usr/local/lib/php.ini
    /usr/local/lib/php.ini.new
    /var/cpanel/version/php.ini-2

    would i be wrong to reckon its the cpanel one that will do the trick /usr/local/cpanel/3rdparty/lib/php.ini i think? - any further ideas?

    cheers

    tom
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you are on cPanel 11, all you have to do to change this is to login to WHM, go to "Service Configuration" then click on "PHP Configuration Editor"

    The bottom entry, just change from 2M to 30M then click save.
     
  3. tomp66

    tomp66 Member

    Joined:
    May 18, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London UK
    ah alas no

    WHM 10.8.0 cPanel 10.9.0-R10737
    Fedora i686 - WHM X v3.1.0

    is our config

    :-(

    what next?

    ta

    tom
     
  4. neonix

    neonix Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    124
    Likes Received:
    2
    Trophy Points:
    0
    Upload this phpinfo script to your server and view the output through your browser.

    This page is going to verify the availability of PHP on your server, and provide you with a lot of information about the PHP itself and the server it's running on. Here's the code:

    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <?php phpinfo(); ?>
    </body>
    </html>

    Go ahead and create a file containing this code -- the file name should end with a .php suffix -- upload it to your server and view it in your web browser just like you would any other web page and look for Configuration File (php.ini) Path,
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Manually edit /usr/local/lib/php.ini

    Note that /usr/local/cpanel/3rdparty/etc/php.ini is used for the cPanel/WHM interface itself. The /usr/local/lib/php.ini file is used for Apache.
     
  6. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    To answer your question, you need to edit the PHP.INI file shown in the phpinfo() screen
    for your PHP installation.

    The default location for the PHP.INI file is /usr/local/lib but your server could be using
    a different location especially if you are using SuPHP or PhpSuExec.

    Create a file with the following:
    Code:
    <?php phpinfo(); ?>
    
    Save the file and view it with your web browser ...

    On that screen, the full path to your PHP.INI file will be shown and that is the PHP.INI
    file that you would need to edit for your changes to be effective.

    If you are not using SuPHP, remember to restart your web server service after making
    any changes to the PHP.INI file or your changes won't take effect.
     
  7. Tymsah

    Tymsah Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Login SSH to your server and Type this command.
    root@server[~]# php -i | grep php.ini

    my server (Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini)
     
Loading...

Share This Page