title: php nginx max upload file size - unusual case
body: <p>I was going through number of pages in google and pretty much all answers associated with this in stackoverflow, bus still, can not get this thing working.</p>
  
  <p>I can upload smaller then 2M files, but not any larger.</p>
  
  <p>I am running Centos 6.2 with <code>PHP-FPM</code> (PHP 5.3.10) and <code>NGINX</code> (nginx version: nginx/1.0.12).</p>
  
  <p>Now I got <code>client_max_body_size 10M;</code> in nginx.conf, in the http section.
  I also got <code>upload_max_filesize = 8M</code> , <code>post_max_size = 8M</code> , <code>memory_limit = 128M</code></p>
  
  <p>usually in almost any answer to this question I have met, these changes helps for users.</p>
  
  <p>Now I done some research, and made this script:</p>
  
  <pre><code>&lt;?php
  //ini_set('upload_max_filesize', '8M');
  $max_upload   = (ini_get('upload_max_filesize'));
  $max_post     = (ini_get('post_max_size'));
  $memory_limit = (int) (ini_get('memory_limit'));
  
  echo ('$max_upload ' . $max_upload);
  echo ('$max_post ' . $max_post);
  echo ('$memory_limit ' . $memory_limit);
  ?&gt;
  </code></pre>
  
  <p>Now If I run in in server terminal - i get <code>$max_upload 8M $max_post 8M $memory_limit 128</code>
  But if I run it via webserver (NGINX) - I get <code>$max_upload 2M $max_post 8M $memory_limit 128</code></p>
  
  <p>So my assumption is that its NGINXes problem, but yet again the only NGINX parameter regarding this matter is <code>client_max_body_size 10M;</code> , which is sec correctly and is placed in the right place in the config.</p>
  
  <p>I am sorry if this is something obvious, or if there is something I have missed, would be glad if someone would point me to the right direction.</p>
  
  <p>Cheers !</p>
  
  <p>EDIT:</p>
  
  <p>So we solved it with AlexeyKa's help. We looked up in <code>phpinfo</code>, and there it said that php was using different php.ini file. Some time ago I made a copy of php.ini into my home directory. And it turnes out that when (some time ago) I restarted php-fpm, it switched from /etc/php.ini file to /home/my-user/php.ini file. Essentially I renamed the /home/my-user/php.ini and restarted the php-fpm. This solved everything, as it switched to /etc/php.ini. I will try to this behavior further, and will update the post, just in case someone will have the same problem.</p>