🦸‍♂️
KT's DevOps Notes
  • Hello World
  • Misc
    • Ubuntu Setup
    • Mac Os Setup
  • Database
    • Redis
      • How To Migrate Redis Data to a DigitalOcean Managed Database
      • How To Connect to a Managed Redis Instance over TLS with Stunnel and redis-cli
    • MariaDB
      • How to Setup MariaDB Galera Cluster on Ubuntu 18.04 with HAProxy
      • How to change innodb_thread_concurrency Read/Wirte Concurrency in MySQL
      • How to change innodb_write_io_threads in MySQL
      • How to change innodb_read_io_threads in MySQL
  • OCI Foundations 2020 Associate Certification | 1Z0–1085–20 | Preparation…
  • Security
  • Ubuntu
    • Apache Server Configuration
      • Configuring Let’s Encrypt SSL Cert for Apache on Ubuntu 18.04
      • Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 18.04
      • Installing Apache on Ubuntu 18.04 with Multiple Domains
    • Nginx Server Configuration
      • Robots.txt disallow all with nginx
      • Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04
      • Installing Nginx on Ubuntu 18.04 with Multiple Domains
      • Configuring Let’s Encrypt SSL Cert for Nginx on Ubuntu 18.04
    • Creating Swap Space on Ubuntu 18.04
    • Dell Inspiron 7559 Ubuntu Linux Guide
    • How to configure Postfix to use Gmail SMTP on Ubuntu 18.04 & 16.04 | LeetDev
  • Setting up SSL Certificates for HAProxy with certbot
  • PHP
  • PHP / Apache: Set Max File Upload and Post Size | LeetDev
  • Upgrade centos7 openssh & openssl to the latest version
  • Downgrading to php7.3 on Amazon Linux 2
Powered by GitBook
On this page
  • 1. Locate php.ini
  • 2. Edit php.ini
  • upload_max_filesize
  • post_max_size
  • 3. Restart Apache/PHP

Was this helpful?

PHP / Apache: Set Max File Upload and Post Size | LeetDev

1. Locate php.ini

Firstly, you need to locate your php.ini file. In this example, our php.ini is located in /etc/php/7.2/apache2/php.ini, however, this may be different for you depending on your PHP version.

2. Edit php.ini

Open your php.ini file with nano.

sudo nano /etc/php/7.2/apache2/php.ini

upload_max_filesize

In nano, press CTRL + W and search for upload_max_filesize and change the value to 64M (for 64 megabytes) or whatever value you require.

/etc/php/7.2/apache2/php.ini

upload_max_filesize = 64M

post_max_size

Press CTRL + W again and search for post_max_size and change the value to 64M (for 64 megabytes) or whatever value you require.

/etc/php/7.2/apache2/php.ini

post_max_size = 64M

Save file and exit. (Press CTRL + X, press Y and then press ENTER).

3. Restart Apache/PHP

Restart Apache to apply changes.

sudo systemctl restart apache2

If you are using PHP-FPM, you may need to restart PHP-FPM service separately.

PreviousSetting up SSL Certificates for HAProxy with certbotNextUpgrade centos7 openssh & openssl to the latest version

Last updated 5 years ago

Was this helpful?