php - 在heroku上编辑php.ini

标签 php wordpress heroku

我已经输入了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/

相关文章:

php - WordPress-错误503-服务不可用

php - 我应该如何在 wordpress 中创建全局选项?

php - WooCommerce 的 WCFM 市场 - 忽略当前产品

ios - 望远镜应用程序无法通过自定义 URL 进行移动响应

heroku - Heroku 上的 Rethinkdb

maven - 在当前项目和插件组中找不到前缀为 'heroku' 的插件

php - 用 PHP 访问 MySQL 字段的 Comments

php - 如何在 Laravel 中过滤缓存的查询

php - composer 中 require 和 install 与 create-project 之间的区别

php - Codeigniter:一次将一行从一个表移动到另一个表