Results 1 to 3 of 3

Thread: Ubuntu 20.04 PHP 7.4 Security Checkup

  1. #1
    Join Date
    Nov 2020

    Ubuntu 20.04 PHP 7.4 Security Checkup

    Hi everyone,

    I'm going to be running PHP 7.4 on my web servers.
    Here are the values I am changing in my PHP.ini file to improve security.

    max_execution_time = 18000
    max_input_time = 18000
    memory_limit = 256M
    post_max_size = 400M
    upload_max_filesize = 400M
    max_file_uploads = 2
    allow_url_fopen = Off
    allow_url_include = Off
    register_globals = Off
    max_input_vars = 100
    safe_mode = On
    sql.safe_mode = On
    session.save_path = lib/php-h2m3c
    soap.wsdl_cache_dir = /var/lib/php-h2m3c/soap_cache
    session.use_strict_mode = 1
    session.cookie_httponly = 1
    session.use_cookies = 1
    session.use_only_cookies = 1
    session.use_trans_sid = 0 = custom_session_id
    session.cookie_secure = 1
    session.referer_check =
    session.hash_function = sha512
    session.bug_compat_42 = 0
    session.bug_compat_warn = 0
    disable_functions = 
    Please let me know if I have missed anything, or anything doesn't look quite right.

    Thanks for your help,
    Last edited by DuckHook; November 24th, 2020 at 10:16 PM. Reason: Removed interfering formatting.

  2. #2
    Join Date
    Mar 2011
    19th Hole
    Ubuntu 20.04 Focal Fossa

    Re: Ubuntu 20.04 PHP 7.4 Security Checkup

    Please use only default fonts and formatting when posting to the forums. Odd fonts are especially problematic when used within code tags.

  3. #3
    Join Date
    Nov 2008
    Metro Boston
    Kubuntu 20.04 Focal Fossa

    Re: Ubuntu 20.04 PHP 7.4 Security Checkup

    The only security modification I routinely make to PHP is to set the default upload directory. Otherwise I use the stock defaults. Have never had an intrusion via PHP in some twenty years. Most of my web sites don't permit the web server "user" to write into any of its directories. Rather than worrying about these settings, I'd spend the time making sure your code is secure. Things like restricting inputs to only valid values, and scanning them for attempted hacks, are more important than these settings.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts