Peter's Portfolio

Modify The PHP 8.X File Upload Limit on Nginx PHP-FPM

PHP Configuration

Go to the php.ini config file

nano /etc/php-fpm.d/www.conf

Modify (or add) these lines into the config file

php_admin_value[memory_limit] = 512M
php_admin_value[upload_max_filesize] = 512M
php_admin_value[post_max_size] = 512M

Nginx Configuration

Go to the global Nginx config

nano /etc/nginx/nginx.conf

Add this line into http{} section

http {
    ...
    client_max_body_size 512M;
    ...

Then restart both of them

systemctl restart nginx
systemctl restart php-fpm

Credit to

https://docs.bitnami.com/aws/infrastructure/nginx/administration/increase-upload-limit-php

https://www.hostinger.com/tutorials/what-is-php/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料