繁体   English   中英

Wordpress php.ini文件将upload_max_filesize设置为大约2MB上传

[英]Wordpress php.ini file to set upload_max_filesize to get around 2MB upload

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

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

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

  2. 然后设置php.ini不起作用:
    php.ini //和php5.ini
    upload_max_filesize = 32M post_max_size = 32M

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

  4. 还尝试了:
    没有.htaccess文件

    • php_value post_max_size 30M
    • php_value upload_max_filesize 30M

我将文件处理到服务器,但是很好奇。
一定有可能吧?

如果您的托管允许您上传自定义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’);

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM