Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit php.ini on heroku

I've put wordpress up on Heroku and have a 2.5MB custom theme I need to upload.

I've installed the wpro plugin to send my uploads directly to s3, however, I still get the error. I think i still need to edit the php.ini file, specifically these lines:

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

I need to change that to 3M.

How can I edit the php.ini file??

like image 912
Eric H. Avatar asked May 29 '26 06:05

Eric H.


1 Answers

The easiest solution to change Heroku's php.ini settings is to create a .user.ini.

This is explained in the Heroku Dev Center Language Support > PHP > Customizing Web Server and Runtime Settings for PHP > PHP runtime settings:

PHP-FPM will read settings from any .user.ini file in the same directory as the .php file that is being served via a web server; if none is found, it will also read settings from a .user.ini file in any parent directory up to your application’s configured document root.

For example to increase the maximum allowed size for uploaded files to 10 MB in a Symfony or Laravel project the .user.ini file should be created in the /public and should contain the following lines:

post_max_size = 10M
upload_max_filesize = 10M
like image 75
louisfischer Avatar answered May 30 '26 18:05

louisfischer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!