• I am trying to get a new WP installation running on my PC and I having problems with getting pictures >2MB into my posts.

    I tried a suggestion made in other posts by creating a php.ini file containing:
    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On

    I had this php.ini file in the wp-admin folder and now in the root but the new Insert Media panel still shows
    “Maximum upload file size: 2MB”

    Obviously something is wrong. I’d appreciate help in getting this fixed.

Viewing 12 replies - 1 through 12 (of 12 total)
  • If you’re running this on your home pc, discard whatever php.ini file you’ve created and edit the limitations directly in the php.ini file on the server.

    Edit this setting:

    ; Maximum allowed size for uploaded files.
    ; https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize
    upload_max_filesize = 2M

    and this setting:

    Maximum size of POST data that PHP will accept.
    ; https://www.php.net/manual/en/ini.core.php#ini.post-max-size
    post_max_size = 8M

    …as required to suit your needs.

    I believe the example lines above are the defaults. Restart apache after you make the changes.

    Thread Starter hapzfl

    (@hapzfl)

    Maybe there is a misunderstanding.

    “edit the limitations directly in the php.ini file on the server”

    My PC is my server = localhost.

    No misunderstanding. In this case the “server” would be your home pc. The php.ini file you need to edit is located inside of the directory where you installed php.

    What did you choose for a server package? WAMP, XAMPP, or something different?

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Did you restart the server so that the changes you made to the .ini file take effect? ??

    Thread Starter hapzfl

    (@hapzfl)

    Thanks for all your help!

    “located inside of the directory where you installed php”

    Which php? There are tons of them in a number of directories. Maybe my ini file is in the wrong one. As I mentioned and suggested elsewhere, I put php.ini first in the wp-admin folder. As that did not work, I moved it to the root folder where wp-activate.php, wp-config.php, etc. are.

    I had problems with getting XAMPP and phpAdmin to get access to MySQL running under Win8. phpAdmin just gave me an error message related to PW failure. And believe me, my PW was correct. Probably another php file with the wrong settings but none of the suggested solutions made a difference. Strangely enough, when I installed WordPress a couple of years ago under Vista I encountered no problems. I never did it under Win7.

    In any case, I uninstalled XAMP and installed WebMatrix. And I have been able to install and run WordPress from there.

    Thread Starter hapzfl

    (@hapzfl)

    Did you restart the server so that the changes you made to the .ini file take effect? ??

    Yes, many times. I.e. after every change; although some posters mentioned that this should not be necessary.

    So you’re on Win 8 right now – am I interpreting that correctly?

    WebMatrix…. (shudder) Haha! Just kidding… sort of. ANYHOW, take a look somewhere around:

    C:\Program Files\IIS Express\PHP\v5.x\php.ini

    I think that might be the path to the file (v5.x being whatever the current version of php is in web matrix). It’s been a while since I messed with…

    (cue the music from the movie “Jaws”) …WebMatrix

    ??

    Thread Starter hapzfl

    (@hapzfl)

    Yes,I am running Win8Pro.

    It’s been a while since I messed with…

    (cue the music from the movie “Jaws”) …WebMatrix

    Well, XAMPP didn’t but WeMatrix2 did work. What can I say.

    Unfortunately, C:\Program Files\IIS Express\.. does not contain a PHP folder. And a php.ini file is only where I put it.
    And I put my localhost on a separate partition and folder. In that folder I put my php.ini file.

    Well, XAMPP didn’t but WeMatrix2 did work. What can I say.

    My comments were purely jovial, my friend. Wink, wink, nod, nod… Bob’s your uncle sort of thing. ?? I care not what weapon you carry into battle, only that it renders you victorious at the end of the day!!

    I’m gonna’ go see if I have a Win 8 image with WebMatrix already installed somewhere in my archives, so I can take a look at the actual path to the real php.ini.

    In the meantime, open up your search option on your Win 8 OS and just plunk in php.ini and see how many files are returned, and note the path to them. I’m betting one will show up.

    “I’ll be back.”

    (say that in the voice of Arnold Schwarzenegger in your head…. C’mon, you know you want to!)

    Using Win 8, WebMatrix2

    The path to the file you want is C:\Program Files\IIS Express\PHP\v5.3\php.ini

    If you are using a 64 bit version, it may also include (x86) in the file path.

    The items you want to edit are located on;

    line 891: upload_max_filesize = 2M

    line 740: post_max_size = 8M

    Point, set, match.

    Have fun!

    Thread Starter hapzfl

    (@hapzfl)

    Thank you, thank you, thank you!!! It worked!!!

    open up your search option on your Win 8 OS and just plunk in php.ini

    That new Win8 search function worked beautifully and showed me immediately the php.ini file in C:\Program Files (x86)\IIS Express\PHP\v5.3\php.ini.

    Yesterday I was not looking into the(x86)folder not being aware that IIS Express might be in both. Why they installed a x86 and a 64bit version and than run the x86 one is a mystery but might have been caused by the WordPress installation?

    Similarly there is a PHP v5.3 and a v5.4 installed but the v5.3 is used.

    In any case, ClaytonJames you saved my day. And hopefully somebody else’s too.

    You’re welcome!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to change upload limit in WP 3.5’ is closed to new replies.