1

I am trying to change the post_max_size from 3M to 100M, i also changed the upload_max_filesize but it's not working, cause when i print echo ini_get('post_max_size'); i always get 3M.

What else Do i have to change in php.ini in order to increment post_size?

This is for a html form which has an input type file, It works fine with files with sizes less than 3m

NOTE: I am using WAMP SERVER

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149

5 Answers5

2

One of the biggest pitfalls for changing PHP.ini configurations is, that you use the wrong file. So create a php file with following content:

<?php
phpinfo();

There you will get a table with the most important infos about your installation. Have a look at the row of the php.ini file, which will look maybe like this:

Loaded Configuration File:  C:\xampp\php\php.ini

Make your changes to this file (from your phpinfo()). After every change, you have to restart your Apache.

bernhardh
  • 3,137
  • 10
  • 42
  • 77
0
string ini_set ( string $varname , string $newvalue )

More informations: http://php.net/manual/de/function.ini-set.php Or as Jozef Dúc recommended: try apache server restart.

Pete
  • 564
  • 4
  • 29
0

In your php.ini go to following line

post_max_size = 3M

Suppose change 3M to 10M if you want to change post size to 10mb.

Please don't forget to restart PHP service to apply changes.

DJ MHA
  • 598
  • 3
  • 18
0

After saving changes, you must restart your server.

Param Kumar
  • 123
  • 3
  • 18
0

I don't know why but at a certain time I couldn't upload certain dimension files. I changed any config and get crazy.

Then had an idea. I got under thie /etc/php folder:

cd /etc/php

And searched for the magic words "post_max_size"

grep -rnw . -e "post_max_size"

And found that a @arg@sh@fu@ file stored this line. The result is this one

./7.4/apache2/php.ini:694:post_max_size = 100M
./7.4/cli/php.ini:694:post_max_size = 8M

So the cli/php.ini I never never used was getting me crazy. I had nooooooo idea why my server was working fine uploading 100M files and from a day to an other switched to the cli file... But the solution is this one. Search into files your key word.

I spend 20 hours on this!!! FOr quite nothing. :(