WordPress.org

Ready to get started?Download WordPress

Forums

How to change upload limit in WP 3.5 (13 posts)

  1. hapzfl
    Member
    Posted 1 year ago #

    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.

  2. ClaytonJames
    Member
    Posted 1 year ago #

    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.
    ; http://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.
    ; http://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.

  3. hapzfl
    Member
    Posted 1 year ago #

    Maybe there is a misunderstanding.

    "edit the limitations directly in the php.ini file on the server"

    My PC is my server = localhost.

  4. ClaytonJames
    Member
    Posted 1 year ago #

    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?

  5. Jose Castaneda
    Member
    Posted 1 year ago #

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

  6. hapzfl
    Member
    Posted 1 year ago #

    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.

  7. hapzfl
    Member
    Posted 1 year ago #

    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.

  8. ClaytonJames
    Member
    Posted 1 year ago #

    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

    :-)

  9. hapzfl
    Member
    Posted 1 year ago #

    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.

  10. ClaytonJames
    Member
    Posted 1 year ago #

    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!)

  11. ClaytonJames
    Member
    Posted 1 year ago #

    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!

  12. hapzfl
    Member
    Posted 1 year ago #

    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.

  13. ClaytonJames
    Member
    Posted 1 year ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic