POST Content-Length even after updating php.ini - php

I changed both upload_max_filesize and post_max_size to 128M. The video I'm trying to upload is only 40MB and shouldn't be causing any issues. If it's any help I'm using MAMP Pro with PHP 5.5.10. I've searched a bunch of places and nothing seems to solve it. Any help would be great. Thanks

MAMP Dynamically creates the php.ini file each time it's run. Changing the file in the physical directory will have no effect on how PHP works. In order to change the php.ini in MAMP Pro you must go to file > Edit Template > PHP > php.ini. After changing this file you should restart MAMP and your changes should work.

Related

How to fix HTTP error on WordPress when uploading an image?

I read all the suggestions online but none of them working for me .The problem I'm having is when I'm trying to upload an image on WordPress it gives HTTP error. I did change the ('WP_MEMORY_LIMIT', '2000M'); but still did not work. I am running with xampp.
change it globaly in php.ini (in xampp located in '\xampp\php\php.ini'):
memory_limit = 256M // search for this "memory_limit" and adjust it by your needs.
if there is no memory_limit in your php.ini file add it and restart xampp/web server

edited my php.ini, but still the phpmyadmin wont increase file size upload

I am trying to increase my upload filesize limit to import an sql file into phpmyadmin.
I have checked the phpinfo and ensured I am modifying the correct php.ini file and adjusted these settings on it:
memory_limit = 200M
post_max_size = 200M
upload_max_filesize = 150M
Have restarted Mamp several times, but still no affect made the file size limit on phpmyadmin.
This is a local build, so no shared hosting to worry about.
By the way I am using MAMP Pro, think that maybe causing a conflict
Thanks a lot for any suggestions
I'm not sure if this is the case in your php.ini file, but don't forget the semicolon. If that doesn't work try this link http://phptale.com/how-to-increase-php-memory-limit/
memory_limit = 128M ;
To adjust the php.ini file in Mamp Pro, you need to open it through the menu system in the application itself, not through the file directory.
File -> Edit Template -> PHP -> php 5.5.10 php.ini
Thanks for all your help

Joomla 3.2 Increase the upload_max_filesiz

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.html
but every time I upload it, it gives me this error:
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".
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.
Edit your php.ini and increase *upload_max_filesize* and *post_max_size*; then restart your web server.
If you don't know where is your php.ini, create a php file to discover: echo php_ini_loaded_file();
The returned path is where your php.ini is located.
EDIT
Well, seems like you have a permission error and not size limit. Try to change permissions of the temp Joomla folder (you can see/configure it on Global Configuration > System).
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:
http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/
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('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
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.
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.
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.
How to change post_max_size and upload_max_filesize in a local installation of Joomla 3 in XAMPP
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.ini in notepad
Find post_max_size and change value to 20M
Find upload_max_filesize and change value to 20M
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_filesize and post_max_size.
Confirm that changes are registered.
This can also happen with the following suhosin setting:
suhosin.upload.disallow_binary = On
Setting it to off temporarily allows you to upload zip files
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'.

Why can I not upload files greater than 2MB? Php.ini has already been edited

I'm having the same problem this guy says he had: PHP still won't allow file uploads larger than 2 MB, although apparently he solved it.
I, however, cannot find a solution. I've edited the php.ini file to the following values:
upload_max_filesize = 20M
post_max_size = 20M
I've even tried raising them to 200M, but it still limits it at 2M, according to phpinfo().
Here are some of the variables per php.ini (name, local value, master value):
file_uploads On On
max_file_uploads 20 20
upload_max_filesize 2M 2M
I've restarted everything. The original value when I checked php.ini for upload_max_filesize was 10M anyway. It will upload smaller files, just nothing above 2MB.
Assicure that you have saved your php.ini.
Restart your webserver for example the service of Apache2 if you use it
Print again a page with phpinfo() and assicure that value has changed if not you haven't wrong file to edit.
Assure that html has attribute MAX_FILE_SIZE
Another way is to change in PHP this setting like:
ini_set('post_max_size', '20M');
ini_set('upload_max_filesize', '20M');
It is possible the file size limit is being overwritten in an .htaccess file, or in your PHP application, through ini_set() calls.
I will also remind you that when you change those values in php.ini, you probably need to restart Apache.
If this isn't something your webhost will let you do, you could always use ini_set() calls yourself, in your script. For example, place this near the top of your script:
ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');
I've had this issue before. If you are running certain versions of web servers, such as running php-fpm with nginx, your php.ini file won't be in the place you expect it. For example, I believe php-fpm doesn't follow the normal php.ini, but rather a www.conf located in it's conf.d directory.
Anyway, check and make sure that your configuration isn't being overridden by a separate php.ini or other config file. If you cannot fix it in this way, you may have luck doing what Richard and Alessandro suggest.
I ran into a similar problem. the setting post_max_size was set to 3M.
I fixed it in the php.ini file from the /wamp/apache/bin folder.
I Hope it helps.
Always ensure that it is the correct php.ini file that you are updating its values.
I spent 2 weeks reconfiguring IIS7 only to realize that there were 2 php.ini files on was in the C:\Program Files (x86)\PHP\v5.4 and the other was in C:\php... however the one that worked was: C:\Program Files (x86)\PHP\v5.4
To ensure that you are on the correct path to the php.ini file
create a phpinfo.php file (structure of file below)
phpinfo();
call the file in the browser like: http://servername/websitename/phpinfo.php
Check the lline shown in pic below to verify that you are indeed editing the correct php.ini file.
Hope this helps cause it helped me. PS. Don't forget to make the changes mentioned above to increase the upload size limit
I also had the same problem and also I did the same changes in the ini.php file
upload_max_filesize = 200M
post_max_size = 200M
But it doesn't solve my problem. So, I went to wamp server in the taskbar (where we can see the green 'W' sign) and left clicked on it
PHP > PHP SETTINGS > upload_max_filesize = 256M (as the changes i made in ini.php were actually not made).
Then it WORKED.
Flogvit pretty much answered my question. WAMP was using a different php.ini file than was listed in the WAMP PHP settings option. I looked at the wamp configuration file and it was just "php.ini." I changed it to the full path of the php.ini file I wanted to use (there was another in the IIS folder), I restarted it and nothing happened. However, after restarting the computer, it now works. For some reason ini_set() doesn't work, however the solution is this:
1) open wampmanager.conf
2) change "phpConfFile = " from php.ini to the full path of the php.ini file you'd like to use, putting it in double quotes.
3) restart the computer that WAMP is on.
Thanks again for the help. That was a pretty weird problem and I don't know why I couldn't just restart WAMP (which runs all the servers, including the Apache server). I'm guessing there was something running outside of WAMP that was being run by WAMP, which is a bit of a mystery to me.
That's because you are editing the wrong config file. Check where your config file is being loaded from and edit that one instead. You might be editing the one located at /etc/php/[version]/cli/php.ini.
In my case, my loaded config file is at /etc/php/7.3/apache2/php.ini

Acquia Drupal 7 - php upload limit won't change

I'm working with acquia-drupal 7 (just localhost for now), inside Microsoft WebMatrix.
I can't get my php upload limit to increase from the default 2MB. Having googled around I have done the following:
added to every existing htaccess:
php_value upload_max_filesize 10M
php_value post_max_size 10M
created php.ini file in every dir that had an htaccess (no php.ini files existed anywhere) containing the following:
upload_max_filesize = 10M
post_max_size = 10M
Restarted the site (through the Webmatrix GUI)
No apparent change whatsoever after any of this - my site still has the 2MB upload limit.
Thoughts?
The reason your changes are not taking affect are because you just created a php.ini file anew, rather than finding the one that is being used.
By definition, since you just created it, it won't be the one that exists in your php directory. :-)
But don't worry! There's an easy way to find the correct php.ini file that your site is using:
Go to /admin/reports/status on your drupal site. Here you will see information about which version of php and apache you're using, etc.
The line for 'PHP' on that page should have both the version of php you're using (something like 5.3.6) and a 'more information' link
Click on that link and you should be able to see detailed information about the php installation on your machine.
Find the line called 'Configuration File (php.ini) Path' on that screen and navigate to that to update it.
Just like you already knew, make sure you restart your server after any changes. :-)
Let us know if this fixes your problem!
Have you ever ran into a problem where you needed to upload relatively large files and still want to be able to manage these from the Drupal 7 administrative interface? If so, you may run into a situation like the one below:
You will notice the 12 MB text stating that we can only upload files that are 12 MB and under. In this case I needed this number to be a little bigger.
In order to do this you will need to modify your PHP settings in your php.ini file.
Note: You should make sure you know what you are doing and understand the consequences of increasing this number. In my case this is on a site that only users that I trust will be uploading files. If you allow any user to upload files, increasing this number can add an increased load on the server and possible eat up your disk space pretty quickly.
Now that you have been warned, here is how I was able to do this. I first found the php.ini file on my system. I am on an Ubuntu server so I was able to get to edit mine using vim like so:
vim /etc/php5/apache2/php.ini
Change the upload_max_filesize setting
The first step was to find the upload_max_filesize setting from 12MB to 30MB.
Change:
To:
Change the post_max_size setting
You may also need to modify the post_max_size setting. I changed the post_max_size php.ini setting from 20MB to 30MB.
Change:
To:
Restart Apache
You should check phpinfo to make sure your php.ini which you edited is the correct one.

Categories