0

Brand new site. Not MU. No matter what I do, I cannot get a file uploaded that exceeds 2MB. I'm running a localhost server with WordPress 4.3.1

I've modified both relevant settings in the the site's php.ini as:

upload_max_filesize = 64M
post_max_size = 64M

However, I'm still getting the message when trying to upload a plugin that's 2.5M

The uploaded file exceeds the upload_max_filesize directive in php.ini.

Also, when I go to "Media > Add New", I get the message:

Maximum upload file size: 2 MB.

My htaccess file is the default and has no mention of max upload size.

What gives? Is it a requirement to restart anything after modifying the site's php.ini? If so, I could not find a restart command on my phpmyadmin panel.

  • Do you have something related to upload_max_filesize in wp-config.php ? – Benoti Dec 19 '16 at 16:45
  • Are you sure you set the correct php.ini? You may have set that for PHP running as CLI. Also why 4.3.1? The latest version is 4.7, you should update for security fixes – Tom J Nowell Dec 19 '16 at 17:19
  • @Benoti nothing in wp-config about that – Scott B Dec 19 '16 at 17:56
  • @Tom - I'm regression testing an issue – Scott B Dec 19 '16 at 17:56
  • @Benoti I'd be happy to place something there but my sense is its overridden by some unseen global that I can't find. – Scott B Dec 19 '16 at 18:18
0

Most likely, there are two php.ini files, one for the local server and one for the site. You can change the site's upload_max_filesize to whatever you want, if the server's php-settings say it's 2 MB, that's it.

So, find the php.ini file of your server install and change the value. Then reboot.

  • There is no php.ini file at the server level. Searching finder for "php.ini" only yields one in each site. If I were to place one there, where should it reside? – Scott B Dec 19 '16 at 17:57
0

Check to see if anything is hooked to the upload_size_limit filter.

This can be a hard one to track down. (I once used a plugin that set it to 1MB for reasons I never figured out. It took a long time to find the issue.)

  • It's a brand new site with a fresh copy of WordPress. Why would this be set in this case? – Scott B Jan 8 '17 at 15:55
0

The first things to check is PHP.ini file. The values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file exactly.

All of these three settings limit the maximum size of data that can be submitted and handled by PHP.

Typically post_max_size and memory_limit need to be larger than upload_max_filesize

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.