【问题标题】:Wordpress php.ini file to set upload_max_filesize to get around 2MB uploadWordpress php.ini 文件设置 upload_max_filesize 以获取大约 2MB 上传
【发布时间】:2015-04-07 14:00:09
【问题描述】:

我买了一个2.2M的模板,wordpress的限制设置为2M。

我正在托管服务器,因此我可以完全访问文件。

  1. 我创建了一个info.php,发现:
    加载的配置文件:无

  2. 然后设置 php.ini 不起作用:
    php.ini // 和 php5.ini
    上传最大文件大小 = 32M post_max_size = 32M

  3. 还尝试设置:
    wp-config.php 定义('WP_MEMORY_LIMIT', '64M');

  4. 也试过了:
    没有 .htaccess 文件

    • php_value post_max_size 30M
    • php_value upload_max_filesize 30M

我将文件复制到服务器,但我很好奇;
应该有可能吧?

【问题讨论】:

  • 我的回答有用吗?

标签: php wordpress wordpress-theming


【解决方案1】:

如果您的主机允许您上传自定义 php.ini 文件,只需在 /wp-admin 文件夹中创建它即可。

upload_max_filesize=280M ;Max file size
max_execution_time=600 ; Script's max execution time, if it's short the file won't upload
memory_limit=1024M ; Memory limit, mine is high because i execute some script when uploading
post_max_size=280M ;Max POST size, it should be the same size as the file size limit

然后在 wp-config 添加:

define(’WP_MEMORY_LIMIT’, ’64M’);

我已经在多台服务器上对此进行了测试,如果它不起作用是因为您的主机阻止了此指令。

【讨论】:

  • 非常感谢,为此花了一整天的时间。这行得通! php.ini 文件,只需在 /wp-admin 文件夹中创建它
猜你喜欢
  • 1970-01-01
  • 2017-03-12
  • 2015-11-29
  • 2014-05-25
  • 2011-11-06
  • 2013-07-01
  • 2013-03-06
  • 2015-01-19
  • 1970-01-01
相关资源
最近更新 更多