How to change the maximum upload file size for PHP scripts

Some PHP applications that process large files require specific php.ini directives configurations to ensure their app can accommodate file sizes larger than the default 128 megabytes. In other cases you may want to reduce the default value to satisfy application constraints. On NodeChef, since your PHP application is fully dedicated in a docker container, you can change these settings at anytime from the dashboard.

Changing the maximum upload file size

You need to change the upload_max_filesize and post_max_size directives. Both directives are explained below:

post_max_size
This directive specified as an integer is the largest amount of bytes that can be sent in the request body of an HTTP POST request to your server. This value must be less than the memory capacity of your NodeChef container and slightly larger than the upload_max_filesize value.

upload_max_filesize
Used to specify the maximum size of a file that can be uploaded to your server.

On NodeChef, to make these changes. Log into the dashboard. On the task manager, click on the App actions button of your app and then click on PHP developer. Under php.ini directives you can set the two values separated by a new line as seen below in the provided textbox. Click on the commit changes button to save your changes and then deploy your application again for the changes to take effect.

upload_max_filesize = 256M
post_max_size = 258M

More information

Show Comments