Problems with php.ini. Need help!

Hello! I use nginx + php 5.4.7 + fpm + wordpress. I have a problem with configuration "uploadmaxfilesize" for php.ini. I wrote all parameters in php.ini, but its doesnt work. If i try to upload file, wordpress write me: "The uploaded file exceeds the uploadmaxfilesize directive in php.ini."

Igrep uploadmaxfilesize /usr/local/lib/php.ini

uploadmaxfilesize = 100M

grep postmaxsize /usr/local/lib/php.ini

postmaxsize = 100M

File that i try to upload = .zip file, size: 2,2 MB.

How i configure the php.ini?

php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib

Loaded Configuration File => /usr/local/lib/php.ini

I went to the /use/local/lib/ and not find the file php.ini. I did the copy of file php-development.ini from /root/php-5.4.7/ and put it to the /usr/local/lib, after that i rename it to php.ini (that succession was in guide, that i found in internet). After that, i opened the file and change pregnants:

uploadmaxfilesize = 100M

postmaxsize = 100M

Thats all.

And yes, i restarted my server many times after that. The linode.com support coludnt find problem and adviced me to ask this question here. Who can help me? :)

6 Replies

Try running a phpinfo(), it'll show you which php.ini file is being used, so you can be sure you're editing the right one.

Running "php -i | grep php.ini" shows you where the commandline version of PHP is getting its config file, not where the web version is (try Nuvini's suggestion through your webserver).

@Nuvini:

Try running a phpinfo(), it'll show you which php.ini file is being used, so you can be sure you're editing the right one.

You was absolutely right. I create info.php and it says that php.ini is in /usr/local/php/etc/php.ini. It was empty. I copied my php.ini that i created few days ago, but it still dont work. WTF?

info php says that

postmaxsize = 8M

uploadmaxfilesize =2M

:(

@Nuvini:

Try running a phpinfo(), it'll show you which php.ini file is being used, so you can be sure you're editing the right one.

Oops, im not a programmer, im just a blogger :).

@kalvinov:

info php says that

postmaxsize = 8M

uploadmaxfilesize =2M
Did it also say this before you made changes to php.ini? Have you also tried restarting nginx?

@NeonNero:

@kalvinov:

info php says that

postmaxsize = 8M

uploadmaxfilesize =2M
Did it also say this before you made changes to php.ini? Have you also tried restarting nginx?

Depending on what you use for php you may also need to restart php itself (/etc/init.d/php restart (may also be called php5 or php-fpm))

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct