WordPress.org

Forums

properly placing php.ini files (4 posts)

  1. ctree
    Member
    Posted 8 years ago #

    Can someone make sense of the following issue: I get php memory allocation errors whenever I try to activate more than 2 plugins at the same time, with the K2 theme (0.9.5rc1) selected.

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 67584 bytes) in /mnt/jd2/06/064/00000017/htdocs/wp/wp-includes/class-snoopy.php on line 345

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 67584 bytes) in /mnt/jd2/06/064/00000017/htdocs/wp/wp-admin/menu-header.php on line 38

    Further investigation on this and other forums indicates that this is by no means uncommon but still rather unusual for a basic blog setup with a new, almost empty database and only a handful of plugins involved. I hope to be able to track down the issue to either the K2 theme or to one of the few plugins I use, but setting that aside for now, I need some help with php.ini configuration.

    Following the suggestions on this page, I added a php.ini file to the root directory of my shared server and increased the memory limit to 24MB.

    The info.php page at root now shows the mem_limit parameter correctly upped to 24MB but I still get the same "out of 8MB" error when I activate additional plugins in the administrative panel of my blog. Why?

    Do I need to place the php.ini file inside the main wordpress directories as well? -- My current directory structure has index.php at root but the wp install is inside its own directory, say /wordpress. Do I need to add the php.ini file to /wordpress, /wordpress/wp-admin, and /wordpress/wp-includes ? -- I've already copied it to the /wordpress dir, no change, but do I need to add it to all three directories (plus root)?

    I am also unsure about the need to (get my provider to) restart the (shared) server. Is this the reason for the discrepancy between what info.php tells me (24MB) and what wp tells me (8MB), or is it about the proper placement of php.ini?

  2. peiqinglong
    Member
    Posted 8 years ago #

    Have you tried restarting IIS? When you make edits to php.ini, you need to restart IIS or the configurations aren't put into play.

  3. ctree
    Member
    Posted 8 years ago #

    peiqinglong, thanks for the suggestion! I'm on apache by the way. So is it correct that info.php will show you the new configuration even though it actually hasn't been applied until the server is restarted?

  4. Pizdin Dim
    Member
    Posted 8 years ago #

    You need to modify the "php.ini" file that apache reads at startup time. Under ubuntu linux this is:

    /etc/php5/apache2/php.ini

    If you're in a shared environment, you'll have to ask your host to do it for you, which they may, or may not want to do. If they don't, find another host.

    Of course, you need to restart apache afterwards.

Topic Closed

This topic has been closed to new replies.

About this Topic