WordPress php.ini 文件设置 upload_max_filesize 以获得 2MB 左右的上传大小

Chr*_* G. 2 php wordpress wordpress-theming

我买了一个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

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

Ska*_*tox 5

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

\n\n
upload_max_filesize=280M ;Max file size\nmax_execution_time=600 ; Script's max execution time, if it's short the file won't upload\nmemory_limit=1024M ; Memory limit, mine is high because i execute some script when uploading\npost_max_size=280M ;Max POST size, it should be the same size as the file size limit\n
Run Code Online (Sandbox Code Playgroud)\n\n

然后在 wp-config 添加:

\n\n
define(\xe2\x80\x99WP_MEMORY_LIMIT\xe2\x80\x99, \xe2\x80\x9964M\xe2\x80\x99);\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n