有没有什么方法可以知道 cPanel 中 WordPress 的最大上传限制并增加它?

发布于 2025-01-09 11:22:45 字数 742 浏览 2 评论 0原文

在我的例子中,最大上传大小仅为 1 MB。我开始在 WordPress 仪表板中的设置中搜索,但没有任何设置,我开始通过发现 WordPress 站点运行状况中声明的一些错误和建议来解决它。我发现了以下两个建议。

!WordPress网站健康性能建议

并且在google搜索中我发现可以在cPanel中的“选择PHP版本”中更改此功能,但此功能不可用,我发现此消息“”PHP Selector is not available.请联系您的托管服务商。”

比我安装的插件解决了我的问题。

我发现谷歌搜索之一在数据库中添加 php.ini 文件并输入以下代码。 对于 PHP.INI 文件

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

OR

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 400M
file_uploads = On
max_execution_time = 180

但创建此文件后托管服务暂停了一段时间。那么,有没有什么安全的方法来增加galary的上传文件大小。

托管服务当前定义的文件大小在哪里?

Maximum upload size in my case was only 1 MB. I started to search in settings in the WordPress dashboard but no any settings for that, started to solve it by finding few errors and recommendations that was declared in WordPress site health. I found two recommendations as follows.

!WordPress site health performance recommendations

and in google search I found that this can be changed in cPanel in "select PHP version", but this feature was unavailable, I found this message ""PHP Selector is not available. Please, contact your hoster."

Than I installed plugin that solved my problem.

One of google search I found to add php.ini file in database and put following codes.
For PHP.INI file

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

OR

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 400M
file_uploads = On
max_execution_time = 180

But after creating this file hosting service put in suspension for sometime. So, is there any safe method to increase upload file size of galary.

Where is current defined file size by hosting service?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年华零落成诗 2025-01-16 11:22:45

您可以通过在主题的functions.php 文件中添加以下代码行轻松增加大小限制。

但是,请记住,如果您更改主题,则最大上传大小将返回到默认值,直到您编辑新主题的functions.php 文件。

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
  1. php.ini 选项

    上传最大文件大小 = 25M
    post_max_size = 13M
    内存限制=15M

“在此处输入图像描述”"

  1. 或者您可以从 wp-config.php 文件

在此处输入图像描述

在任何文本编辑器中打开该文件并添加以下代码。

@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );

You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.

However, remember if you change the theme then max upload size will return to its default values until you edit the functions.php file of the new theme.

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
  1. php.ini Option

    upload_max_filesize = 25M
    post_max_size = 13M
    memory_limit = 15M

enter image description here

  1. Or you can do from wp-config.php File

enter image description here

Open the file in any text editor and add the following code.

@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文