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.

Suggested max upload_max_filesize and post_max_size php.ini file ?

Discussion in 'Security' started by Smaily, Jul 19, 2013.

  1. Smaily

    Smaily Well-Known Member

    Joined:
    Sep 19, 2011
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I have changed my php.ini limits

    /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini
    /usr/local/lib/php.ini

    Code:
    max_execution_time = 30
    max_input_time = 60
    memory_limit = 128M
    
    log_errors = On
    log_errors_max_len = 1024
    ignore_repeated_source = Off
    
    report_memleaks = On
    track_errors = Off
    register_argc_argv = On
    post_max_size = 2500M
    gpc_order = "GPC"
    
    auto_prepend_file =
    auto_append_file =
    
    default_mimetype = "text/html"
    include_path = ".:/usr/lib/php:/usr/local/lib/php"
    doc_root =
    user_dir =
    
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
    zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
    extension = "suhosin.so"
    extension = "pdo.so"
    extension = "pdo_sqlite.so"
    extension = "pdo_mysql.so"
    extension = "sqlite.so"
    extension = "ixed.5.3.lin"
    
    suhosin.request.max_vars = 2048
    suhosin.post.max_vars = 2048
    suhosin.cookie.encrypt = Off
    suhosin.memory_limit = 128M
    suhosin.session.encrypt = Off
    suhosin.get.max_value_length = 2048
    suhosin.get.max_name_length = 2048
    suhosin.request.max_varname_length = 2048
    enable_dl = Off
    file_uploads = On
    upload_max_filesize = 2500M
    allow_url_fopen = On
    default_socket_timeout = 60
    smtp_port = 25
    sendmail_path = "/usr/sbin/sendmail -t -i"
    sql.safe_mode = Off
    
    mysql.allow_persistent = Off
    mysql.max_persistent = -1
    mysql.max_links = -1
    mysql.default_port =
    mysql.default_socket =
    mysql.default_host =
    mysql.default_user =
    mysql.default_password =
    mysql.connect_timeout = 60
    mysql.trace_mode = Off
    
    session.gc_probability = 1
    session.gc_divisor = 100
    session.gc_maxlifetime = 1440
    session.cache_limiter = nocache
    session.cache_expire = 180
    
    Worried if I changed them to too large values?
    post_max_size = 2500M
    upload_max_filesize = 2500M

    I just wanted to be able to upload more higher size .sql file then 100-200MB because I had such database without having to split it or pack it.

    What happens if specifyed too high value? In means of security and server physical load/status.
    Total processors: 8 (2xQuad core Intel(R) Xeon(R) CPU E5405 @ 2.00GHz)
    RAM: 32GB (16x2GB)
    Interface is running bond mode 6.

    Anything else I should pay attention in php.ini?
    I also noticed simply editing /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini gets overwritten in time.
    And by question I don't use port 25SMTP. Only php.ini has it set. Other then that WHM has changed outgoing port into 26 and 587, so is firewall. 25 should be blocked. what mail is going out using that port and can I change it?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    If you want to upload large databases file on your server through phpmyadmin then there is no need to increase the upload limit in your /usr/local/lib/php.ini file, Change the upload limit in /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini file for the large .sql file
     
  3. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You can't block 25 out, because the other servers your server is sending to are listening in that port.
    However you can, in your firewall, allow only specific users (usually root, exim and mailman) to use SMTP port.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You should considering using the command line to import large databases. EX:

    Code:
    mysql database_name < /path/to/file.sql
    There is no need to worry about PHP upload limits when you import a database this way.

    Thank you.
     
Loading...
Similar Threads - Suggested max upload_max_filesize
  1. teknom
    Replies:
    1
    Views:
    111

Share This Page