I wants to upload 6MB image in the products of the magento store. Please help me where i have to change my maximum limit ? This code did not work in php.ini file
upload_max_filesize = 10M
post_max_size = 10M
Any suggestion would be appreciable
Typically the server process (apache, httpd or php-cgi) needs to be restarted after making changes to php.ini. This might be why you are not seeing any difference.
Another way is to put your upload_max_filesize and post_max_size settings in a .htaccess file in the root of your Magento directory. Apache tends to read that more often.
Are you getting an error when you upload the file, or does it just time out? It might be that the dimensions of the image (say 4,000 x 5,000) are too big for scaling/cropping.
Place a file in your root with in it and call it phpinfo.php. Now go to http://www.yoursite.com/phpinfo.php and see what the maximum upload size is.
If you are on shared hosting it may not be possible to increase your php settings beyond what your hosting provider allows. This could be the reason why your settings are not taking hold. Run phpinfo.php and take things from there.
Related
I'm using laravel and filepond to upload some files. It works fine with files smaller than 100MB, but if I try to upload bigger (400MB) files I get 413 error.
I have already increased post_max_size and upload_max_filesize in php.ini and changed client_max_body_size in nginx, but it still does not work.
I'm missing something?
Best regards
Its php and nginx related.
Check which php.ini is used php --ini
Sometimes there are multiple ones that change the original value
Search in all php.ini files cat /path/php.ini | grep upload_max_filesize
Last thing is, make sure you restart nginx and php after the changes
Check that the PHP interpreter is reading from the php.ini that you are editing.
Check whether your server resources is sufficient i.e memory size is not exhausted in the process of file uploading. htop can tell you resource consumption on your server. If on php.ini you put values to post_max_size, upload_max_filesize or memory_limit that exceed your server resources, you are most likely to meet the "413 Content Too Large" error.
Error: 413 Request Entity Too Large
I have attempted to increase upload_max_filesize to 20M using the Edit PHP FPM Configuration and Edit PHP CLI Configuration tools in Laravel Forge. It successfully saves my settings, but the changes don't seem to take affect. I have tried restarting nginx and the server.
Environment:
AWS EC2
nginx
Updating since this is the first search engine result for a search on this topic:
Forge now has a built-in setting you can update by going to the server details page and then clicking on PHP from the menu on the left. You'll see a form to change the max file size.
As #dave-alvarez mentioned, there is a setting in Laravel Forge to do this.
Select your server & choose PHP from the left menu.
Set Max File Upload Size as a megabyte integer (with no trailing unit).
Confirm your change by going to the bottom of the page & clicking the Files pull-up, Edit PHP FPM Configuration option. You can search the php.ini for upload_max_filesize.
I was missing a piece. Here's the whole answer.
Nginx Configuration
Add the following line to http or server or location context to increase the size limit in nginx.conf:
# set client body size to 20M #
client_max_body_size 20M;
PHP Configuration
Edit php.ini and set the following directives:
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 256M
;The maximum size of an uploaded file.
upload_max_filesize = 20M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 30M
Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/
i have a problem with taking magento backup (both system, database and db + media backup). When taking backup everything seems to be working, but when finished the backup does not appear on the backup site or Var/backup.
First i tought the problem was memory limit since the webshop is big, but increasing the memory limit to 256m didnt solve the problem (http://dreamaquarium.no/nettbutikk/php.ini)
I was also thinking the problem was permissions in the backup folder, but does not seems like that is the problem (what permission should i use?).
When i accessed the backup folder i found a .htaccess with the following content: deny from all. I deleted the .htaccess, and ran a backup - and it didnt seem to fix the problem.
Sooo any suggestions how to make the backup work?
i had the same problem with my magento shop. The the reason was a combination of to low memory limit and execution time.
So i suggest you to do the following:
max_execution_time = 360;
memory_limit = 512M
Also set max_allowed_packet to 500M in my.ini/my.cnf fil under[mysqld] .
Regards, S.T
I just had my server people install APC to try to decrease the amount of memory that my server uses per person.
I went into my local.xml and entered in the following within the Global mark.
<cache>
<backend>apc</backend>
<slow_backend>database</slow_backend>
<prefix>MYSTORE_</prefix>
</cache>
</global>
I then reset apache.
Then in my php.ini file I have the following:
;APC SETTINGS
apc.enabled=1
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=10M
apc.stat=0
apc.optimization=0
apc.shm_segments=1
apc.enable_cli=1
apc.cache_by_default=1
apc.include_once_override=1
I was able to increase the size and actually enter in these settings buy updating the master php.ini on my server (rather than the local one).
However, when I go into system cached entires it only shows hidden/apc.php and on the dashboard it only shows the 1 file.
Can you guys please help me figure this out? I'm running magento 1.9.1, PHP 5.4.35, APC 3.1.13, Apache 2.2.29.
Thanks!
You're missing
extension=apc.so
Also APC is at the server/php level. The cache block in the XML is to configure higher level caching systems such as Redis.
I created a joomla site on my shared hosting this morning. Everything was going great, I was uploading content. And suddenly when I went to create my third category, I got the following error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/mysite/public_html/libraries/phputf8/utils/unicode.php on line 208
I tried max_execution in a custom php.ini but it has still not helped me.
I am unable to contact my hosting company as they do not have a support forum or anything.
Is there any way to repair this issue?
#Dasun is right, 32 mb is an awful lot of memory:
turn the debug feature on (administrator -> global configuration -> system -> debug system) and you'll see who's eating up so much memory. If you can't get rid of the module/component, try to enable cache with a long timeout.
And definitely change hosting provider as soon as possible!
Yep get a new host — how they function without a means of contacting them is beyond me.
The error is saying that you've only got a 32Mb allowance for PHP to run in and when PHP tried to allocate more than that it failed.
You could try increasing the setting for PHP in a site based php.ini file. e.g.
memory_limit=64M;
Or, if a local php.ini doesn't work you could try adding in this to the top of your .htaccess (assuming you're on a LAMP server)
php_value memory_limit 64M
If your host allows it this will override the memory_limit setting for just that site.
I just had a customer with a very similar problem. They have a cPanel site, where the default memory allotment was set as 32M. I found another forum where they suggested adding the line below to both the index.php in the Joomla home space, and also in the index.php file in the administrator folder. Worked like a charm. I added it directly below the opening php tag.
ini_set('memory_limit','64M');
This answer was found at http://www.robertwent.com/blog/joomla/19-joomla-increase-php-local-memory-limit-without-changing-server-settings
Hope it works for you
(this is my first "answer" on this site ... apologies if I've not answered in the the site's official way)