我买了一个2.2M的模板,wordpress的限制设置为2M。
我托管服务器,因此我可以完全访问文件。
我创建了一个 info.php 并发现:
加载的配置文件:无然后设置 php.ini 不起作用:
php.ini//和 php5.ini
上传最大文件大小 = 32M post_max_size = 32M还尝试设置:
wp-config.php 定义('WP_MEMORY_LIMIT','64M');还尝试过:
没有 .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’);
我已经在多个服务器上对此进行了测试,如果它不起作用,是因为您的主机阻止了该指令。
关于php - WordPress php.ini 文件设置 upload_max_filesize 以获得 2MB 左右的上传大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28382510/