我已经输入了wordpress up on Heroku并且有一个 2.5MB 的自定义主题我需要上传。
我已经安装了the wpro plugin将我的上传直接发送到 s3,但是,我仍然收到错误。我想我仍然需要编辑 php.ini 文件,特别是这些行:
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M
我需要将其更改为 3M。
如何编辑 php.ini 文件?
最佳答案
更改 Heroku 的 php.ini
设置的最简单解决方案是创建 .user.ini
。
Heroku 开发中心对此进行了解释 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.
例如,要将 Symfony 或 Laravel 项目中上传文件的最大允许大小增加到 10 MB,应在 /public
中创建 .user.ini
文件并且应包含以下行:
post_max_size = 10M
upload_max_filesize = 10M
关于php - 在heroku上编辑php.ini,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18796980/