php Joomla 3.2 增加upload_max_filesiz
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20400046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Joomla 3.2 Increase the upload_max_filesiz
提问by Aly_Elgahy
I am trying to download this template on Joomla 3.2 extension manger : http://scriptmafia.org/templates/115622-yt-moustache-yootheme-for-joomla-25-32.htmlbut every time I upload it, it gives me this error:
我正在尝试在 Joomla 3.2 扩展管理器上下载此模板:http: //scriptmafia.org/templates/115622-yt-mustache-yootheme-for-joomla-25-32.html但每次我上传它时,它都会给我这个错误:
There was an error uploading this file to the server.
将此文件上传到服务器时出错。
I have read articles about "increase the upload max size in the php.ini file". I have tried to find this file in the administrator files section in Joomla, but it is "not found".
我已阅读有关“增加 php.ini 文件中的最大上传大小”的文章。我试图在 Joomla 的管理员文件部分找到这个文件,但它“没有找到”。
So how can I fix this problem? It has not happened for this template only, it has happened for several. So I am almost sure it is due to the upload size.
那么我该如何解决这个问题呢?它不仅发生在这个模板上,而且发生了好几次。所以我几乎可以肯定这是由于上传大小。
采纳答案by Balaji Kandasamy
If you are using XAMPP , php.ini file will be located in c:\XAMPP\php folder. Find the file and increase file upload size there. If you are using WAMP, You can find ini file in /wamp/bin/php directory. The location may vary from one OS to another. You can follow this link:
如果您使用 XAMPP , php.ini 文件将位于 c:\XAMPP\php 文件夹中。找到该文件并在那里增加文件上传大小。如果您使用的是 WAMP,您可以在 /wamp/bin/php 目录中找到 ini 文件。位置可能因操作系统而异。你可以点击这个链接:
http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/
http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/
回答by izn
Edit your php.iniand increase *upload_max_filesize* and *post_max_size*; then restart your web server.
编辑你的php.ini并增加 *upload_max_filesize* 和 *post_max_size*;然后重新启动您的网络服务器。
If you don't know where is your php.ini, create a php file to discover: echo php_ini_loaded_file();
如果你不知道你的 php.ini 在哪里,创建一个 php 文件来发现: echo php_ini_loaded_file();
The returned path is where your php.ini is located.
返回的路径是您的 php.ini 所在的位置。
EDIT
编辑
Well, seems like you have a permission error and not size limit. Try to change permissions of the tempJoomla folder (you can see/configure it on Global Configuration > System).
好吧,似乎您有权限错误而不是大小限制。尝试更改临时Joomla 文件夹的权限(您可以在全局配置 > 系统上查看/配置它)。
回答by Neil Robertson
If you can't resolve the PHP limitation easily, an alternative is to FTP the installation file to the /tmp folder and in Extension Manager -> Install, use the "Install from Directory" option instead.
如果您无法轻松解决 PHP 限制,另一种方法是将安装文件通过 FTP 传输到 /tmp 文件夹,然后在扩展管理器 -> 安装中,改用“从目录安装”选项。
回答by Nick Tsarev
You can call in your script ini_set function and change values, which have been stored in php.ini (any changes has affected only for current script, but not for global settings)
您可以在脚本中调用 ini_set 函数并更改存储在 php.ini 中的值(任何更改仅影响当前脚本,但不影响全局设置)
ini_set('post_max_size', "%value in MiB for example 16M%")
ini_set('upload_max_filesize', "%value in MiB for example 16M%")
You can read more about it at php.net
你可以在php.net 上阅读更多关于它的信息
回答by DShack
Had the same issue for the longest time, none of the answers helped. Found that if you are using GoDaddy, and go to your CPanel, scroll down to Software, then choose PHP version, switch to PHP Options, there you can change your upload file size. Hope this helps, took me forever to find it.
最长时间遇到同样的问题,没有一个答案有帮助。发现如果您使用的是 GoDaddy,请转到您的 CPanel,向下滚动到软件,然后选择 PHP 版本,切换到 PHP 选项,您可以在那里更改上传文件的大小。希望这会有所帮助,我花了很长时间才找到它。
回答by Parm
Some people might be having a issue with the memory allocation portion of php.ini file "memory_limit" the default for me was 128mb and i was attempting to upload nearly 300mb and it hit that roadblock. After changing the default value to 512mb and restarting the server i was able to get past this limit.
有些人可能对 php.ini 文件“memory_limit”的内存分配部分有问题,我的默认值是 128mb,我试图上传近 300mb,结果遇到了这个障碍。将默认值更改为 512mb 并重新启动服务器后,我能够超过此限制。
回答by Guest
How to change post_max_sizeand upload_max_filesizein a local installation of Joomla 3 in XAMPP
如何在 XAMPP 中更改post_max_size和upload_max_filesize在本地安装 Joomla 3
- You can check the php setting in two places – site's backend under system information – go to php information. Or on browser go to localhost and click on phpinfo. You'll find the post and upload part under “Core” heading.
- Go to
c:\xampp\php\ - Find the file
php.ini - Open
php.iniin notepad - Find
post_max_sizeand change value to20M - Find
upload_max_filesizeand change value to20M - Save the file
- Logout out of your site backend.
- Turn off apache and mysql on xampp and quit
- Restart xampp as administrator
- Turn on apache and mysql
- Open browser and go to localhost
- Open phpinfo and search for
upload_max_filesizeandpost_max_size. - Confirm that changes are registered.
- 你可以在两个地方查看php设置——系统信息下的站点后端——进入php信息。或者在浏览器上转到 localhost 并单击 phpinfo。您将在“核心”标题下找到帖子和上传部分。
- 去
c:\xampp\php\ - 找到文件
php.ini php.ini在记事本中打开- 查找
post_max_size并将值更改为20M - 查找
upload_max_filesize并将值更改为20M - 保存文件
- 从您的站点后端注销。
- 在 xampp 上关闭 apache 和 mysql 并退出
- 以管理员身份重启 xampp
- 开启apache和mysql
- 打开浏览器并转到本地主机
- 打开 phpinfo 并搜索
upload_max_filesize和post_max_size。 - 确认更改已注册。
回答by Stuart Cardall
This can also happen with the following suhosinsetting:
这也可能发生在以下suhosin设置中:
suhosin.upload.disallow_binary = On
Setting it to offtemporarily allows you to upload zip files
将其设置为off临时允许您上传 zip 文件
回答by Sichys
If you use CPanel, search for PHP version (in the Software section) and click on it, then click on 'switch to PHP Options', the options will display then look for 'upload_max_filesize' and click on the value to change it. Do the same for 'post_max_size'.
如果您使用 CPanel,搜索 PHP 版本(在软件部分)并单击它,然后单击“切换到 PHP 选项”,将显示选项,然后查找“upload_max_filesize”并单击值进行更改。对“post_max_size”执行相同的操作。

