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.

Local php.ini Max Upload Size

Discussion in 'General Discussion' started by tripwire, Jul 24, 2008.

  1. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I'm trying to adjust my upload_max_filesize to accept larger uploads, but I'm having a problem. I don't want to adjust my server wide php.ini file to do this as it will effect all sites on my server. I just want to control the uploading on one particular site. I've added a php.ini file to the folder of the site I'm uploading to but it doesn't seem like it's being read.

    Does anyone have any idea how I should do this?
     
  2. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Ok my server using apache 2.2.8 is running suPHP so I don't get why this isn't working. Is there some suphp configuration I need to set first?
     
  3. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    In reading somemore in this post to create a local php.ini file I have:

    Created a suphp.conf file in:
    /usr/local/apache/conf/userdata/std/2/domain/suphp.conf

    Inside the file I have:
    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/user/php/
    </IfModule>

    Inside my /home/user/php directory I have my php.ini file.

    I then ran /scripts/ensure_vhost_includes --user=username which created
    Include "/usr/local/apache/conf/userdata/std/2/username/domain/*.conf" in my httpd.conf file.

    Now when I do a phpinfo() on my site I still see my loaded configuration file being /usr/local/lib/php.ini instead of it being read locally from the /home/user/php/php.ini

    Am I missing a step somewhere??
     
  4. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    In working on this for the past few days I'm beginning to think there is a problem with my httpd.conf file that is taking precedence over my suPHP_ConfigPath settings in my virtualhost include. I've checked my suphp.conf file and everything there seems fine to allow a custom php.ini so I don't know what else to try. Maybe it's not possible.
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You didn't create the proper userdata file.

    Your last post says:

    /usr/local/apache/conf/userdata/std/2/domain/suphp.conf

    This should be:

    /usr/local/apache/conf/userdata/std/2/username/domain/suphp.conf
     
  6. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hi sparek-3 ... sorry I wrote that line wrong. I did do it the way you mentioned:

    /usr/local/apache/conf/userdata/std/2/username/domain/suphp.conf

    Are there certain permissions that I need set on the php.ini file or something...
    I don't know what else to check here.
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Make sure that domain in the /usr/local/apache/conf/userdata/std/2/username/domain/suphp.conf path matches up with the ServerName of the VirtualHost entry in the httpd.conf file.

    Another words, open the httpd.conf file and search for domain in that file. If it doesn't show up next to a ServerName directive, then you are using the wrong domain name in this path.
     
  8. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    The serverName in the httpd.conf file exactly matches the domain in the /usr/local/apache/conf/userdata/std/2/username/domain/suphp.conf path.

    Here's my virtualHost entry in my httpd.conf:

    Code:
    <VirtualHost ip:80>
        ServerName domain
        ServerAlias www.domain
        DocumentRoot /home/username/public_html
        ServerAdmin webmaster@domain
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/domain combined
        CustomLog /usr/local/apache/domlogs/domain-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ## User username # Needed for Cpanel::ApacheConf
        <IfModule mod_suphp.c>
            suPHP_UserGroup username username
        </IfModule>
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            php5_admin_value open_basedir "/home/username:/usr/lib/php:/usr/local/lib/php:/tmp"
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/local/lib/php:/tmp"
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup username username
        </IfModule>
        ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
      
        Include "/usr/local/apache/conf/userdata/std/2/username/domain/*.conf"
    
    </VirtualHost>
    
     
  9. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try adding a location container.

    In the file /usr/local/apache/conf/userdata/std/2/username/domain/suphp.conf make this read as:

    Code:
    <IfModule mod_suphp.c>
    <Location />
    suPHP_ConfigPath /home/user/php
    </Location>
    </IfModule>
    Alternatively, are you sure that mod_suphp is being loaded by Apache?
     
  10. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Sparek-3, thanks for your help so far. I tried adding the location container, but it didn't help.

    I was sure that the mod_suphp was being loaded into Apache because through tests my php pages are shown as running under the owners username. In looking through my httpd.conf file there is no mention of suPHP_Engine On though so maybe I am missing something there. Is there any additional mod_suphp configuration that needs to be present in httpd.conf?
     
  11. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try reading the file at /usr/local/apache/conf/php.conf or try the Configure PHP and SuExec in the WHM.

    I am not exactly sure how all easyapache sets up suphp and what files contain or need to contain what directives.
     
  12. acenetgeorge

    acenetgeorge Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2008
    Messages:
    64
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Southfield, MI
    cPanel Access Level:
    DataCenter Provider
    Just a quick question,

    Did you include a max_post_size in your php.ini? You usually need to pair these two settings up. That could be causing the problem.
     
  13. tripwire

    tripwire Member

    Joined:
    Apr 9, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Ah-Hah, yes finally! I checked my php.conf file and there was no mention of suPhp there either, so I checked the Configure Suexec and PHP in WHM and noticed that the PHP 5 Handler was set to cgi instead of suphp. Everything is working great now. Thanks again for the help sparek-3.
     
Loading...

Share This Page