HomeAboutContact
Book Consultation

Enterprise AI integration and software delivery for teams that need velocity without compromising security, compliance, or craft.

inquiries@advantageaieng.com

Services

  • AI & Automation
  • Product Engineering
  • Cloud & DevOps
  • Security

Company

  • About
  • Contact
  • Blog
  • FAQ

© 2026 Advantage AI Engineering Private Limited. All rights reserved.

Privacy Policy·Terms & Conditions
All posts

DevOps

Increase File Upload Size in Ubuntu + Apache (For SQL & .gz Files)

Advantage AI Engineering · April 30, 2026 · 5 min read

Increase File Upload Size in Ubuntu + Apache (For SQL & .gz Files)

Raise PHP upload limits so you can import large .sql and .sql.gz files through Apache—then verify with phpinfo and learn a faster terminal import pattern.

Running into the 2MB upload limit when uploading .sql or .sql.gz files on Ubuntu + Apache? This limit usually comes from PHP defaults. Here is a concise fix.

1. Edit php.ini

Check your installed PHP version:

php -v

Open the Apache SAPI php.ini for that version (replace 8.x with your major.minor, e.g. 8.2):

sudo nano /etc/php/8.x/apache2/php.ini

Update (or add) these directives—values are a common starting point; tune to your workload:

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 512M
max_execution_time = 300

2. Restart Apache

sudo systemctl restart apache2

3. Verify changes

Create a small phpinfo page in your web root (remove it after verification for security):

<?php phpinfo(); ?>

Open it in the browser, for example:

http://your-server-ip/phpinfo.php

Confirm the updated values for:

  • upload_max_filesize
  • post_max_size

Bonus: import large SQL files faster

phpMyAdmin can be slow for very large dumps. When you have shell access, streaming a compressed backup straight into MySQL is often faster:

zcat backup.sql.gz | mysql -u root -p your_database

Related

  • Exploring PHP: Powering Dynamic Websites with Ease — Part 3
  • Exploring PHP: Powering Dynamic Websites with Ease — Part 2