Incorrect Memory Allocation for subsite
-
Hello!
I am administering a WPMU site for a client, and they are experiencing issues related to memory management. First, they were receiving errors (Fatal error, blah, blah), and now they are getting the blank white pages for Pages in the Admin area.
I believe the culprit can be related to Visual Composer, but now activating or de-activating that plugin no longer seems to help.
What I don’t understand is that on the sub-site dashboard, there is the “widget” for WP News. Here, it shows
Fatal error: Out of memory (allocated 33554432) (tried to allocate 109340 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/wp-db.php on line 1208
But, at the bottom, I have installed Server IP and Memory plugin, which shows correctly:
Thank you for creating with WordPress. | Memory: 30.41 of 128 MB (24%) | WP LIMIT: 128 MB | IP xx.xx.xx.xx | PHP 5.6.15 @32BitOS Version 4.4.1
So, it seems to me that the plugin is correctly reading the memory allocated in both php.ini and wp-config.php, yet the WP News widget and other parts of the site are still assuming 32MB of possible memory? How is that possible?
Any help on this issue would be greatly appreciated!
-
Hello, 3daysaside, & welcome to the WordPress support forum.
I wonder if you could be a bit more specific about that fatal error. I suspect that’s where the problem actually lies, i.e., a theme or plugin incompatibility, as opposed to a memory problem per se. That error might very well point you to a plugin or theme that’s causing the difficulty.
Please let us know how you get on w/this.
Hi,
Try entering something like this into your wp-config.php
define('WP_MEMORY_LIMIT', '96M');and let us know if it helped.
Hello!
Thanks for your assistance! @georgetasioulis I do in fact have the line you speak of in my wp-config.php file, except I moved it up to 128M after the client continued to have issues.
@jackie McBride That fatal error occurs on the subsite Dashboard page, where the WP-News is supposed to be displayed. Here’s a link to the screenshot:
There you can see the Fatal error on the bottom right of the dashboard, and the memory and PHP settings at the very bottom of the image.
The biggest issue, really, is when you try to edit a page, and get nothing but a blank white page. So, unfortunately, no error to go off of there, but that used to be where a blank paged PHP fatal memory error would appear.
Thanks for your continued help!
Ok, so my brain must’ve been fried, I can’t believe I didn’t ask for this previously, but is there any chance you could provide a link to your site?
Also, do you have any error logs you can show us? Because for some reason, I’m rather suspecting the error you’re seeing might not be the only one.
Lastly, could you provide a copy of your wp-config.php *minus any database infomation, please!!* & your .htaccess file?
If you’re not sure how to do this, please ask for instructions. & again, please ensure that no information about your database exists in the wp-config.php file that you post. I’ve seen folks inadvertently post database information to public forums, which is definitively not a good thing.
Is it possible that your hosts php.ini memory_limit is set to 32M?
Could you create a phpinfo page on your website’s document root and check it out?Simply create a file (name it whatever you want) with a .php extension and use a text editor to enter the following:
<?php phpinfo() ?>Then open that file using your browser, search for
memory_limitto see what it’s set to and let us know.Update: on what line in your wp-config.php do you have the
WP_MEMORY_LIMITdefine entry? I’d recommend you to move it up to line 2, right below<?phpOK!
Here are the updates:
1) link to site (not designed or updated by me): http://www.prenetworking.net/chapters/brandywine/
2) Moved the memory limit line up to number 2 in my wp-config. Here is the updated file:<?php define( 'WP_MEMORY_LIMIT', '128M' ); /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Codex page. You can get the MySQL settings from your web host. * * This file is used by the wp-config.php creation script during the * installation. You don't have to use the web site, you can just copy this file * to "wp-config.php" and fill in the values. * * @package WordPress */ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'xxx'); /** MySQL database username */ define('DB_USER', 'xxx'); /** MySQL database password */ define('DB_PASSWORD', 'xxx'); /** MySQL hostname */ define('DB_HOST', 'xxx'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', ''); /**#@+ * Authentication Unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here'); define('AUTH_SALT', 'put your unique phrase here'); define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here'); /**#@-*/ /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */ $table_prefix = 'wp_'; /** * WordPress Localized Language, defaults to English. * * Change this to localize WordPress. A corresponding MO file for the chosen * language must be installed to wp-content/languages. For example, install * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German * language support. */ define('WPLANG', ''); /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */ define('WP_DEBUG', false); define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/chapters/'; define( 'DOMAIN_CURRENT_SITE', 'www.prenetworking.net' ); define( 'PATH_CURRENT_SITE', '/chapters/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 ); /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php');3) .htaccess:
AddType x-mapp-php5 .php RewriteEngine On RewriteBase /chapters/ RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] RewriteRule . index.php [L]4) My phpinfo.php file states 128M under Core.
5) I’m not exactly sure where/how to generate the error logs with my shared host. For this client, unfortunately they’re on 1&1. I think I can start error logging looking at a knowledge base article, but not sure if that’s what you’d like to see?
6) Just for kicks, the only thing that isn’t working right now is clicking on “Pages”, which returns a completely blank white page (with no code in the source).I think that’s it for now — please let me know what else I can supply and what you’d like me to try with the error logging — I sincerely appreciate your assistance!
OK so the WP-News box in the dashboard started working after you moved
define( 'WP_MEMORY_LIMIT', '128M' );to line 2?In order to fix the Pages blank page I’d recommend you to enable full logging in
wp-config.php.
Please add the following:// Turn debugging on define('WP_DEBUG', true); // Tell WordPress to log everything to /wp-content/debug.log define('WP_DEBUG_LOG', true); // Turn off the display of error messages on your site define('WP_DEBUG_DISPLAY', false);and then try clicking on “Pages”. Finally open the file /wp-content/debug.log and see if anything stands out (if in doubt, upload it to pastebin and post the link here so we can have a look too).
Thank you for your quick reply!
@george — it did not. The error message still states something like this:
Fatal error: Out of memory (allocated 33554432) (tried to allocate 218647 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/wp-db.php on line 1127
Here is my pastebin (and thank you for the debugging constants to add to wp-config, that’ll be very useful in the future):
Not really knowing what’s up, this is what stands out to me: 1) Line 57 references the WordPress News error on the dashboard (again not using the full 128M); 2) after enabling debugging and the other items, I now get a 500 error instead of the white page (which, any message is nice, of course); 3) I’m guessing with the repetition of the ‘deprecated’ errors, maybe my client has a couple of plugins that need to be updated?
Thanks again!
Yeap there’s definitely some outdated plugin there. I would start by temporarily deactivating
nextgen-smooth-gallery(https://wordpress.org/support/topic/plugin-nextgen-smooth-gallery-will-smoothgallery-ever-work-with-wordpress-3x) to see if “Pages” starts working again.Then could you also add a
MAX_MEMORY_LIMITline right afterWP_MEMORY_LIMIT, so that yourwp-config.phplooks something like this?define(‘WP_MEMORY_LIMIT’, ‘128M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);Wow…thank you for the link on Smooth Gallery — I’ve been trying to prove that the client updated WordPress and it didn’t automatically update itself (it’s been updated to 4.4.1, but I installed the original back in 2012), and that might actually help me to pin some things down.
Next, sorry for bugging you all for plugin issues — but now that I’ve disabled that plugin, the Pages section has started working again! Which is fantastic. But, while I still have assistance here, the plugin that they rely upon is Visual Composer, and that is still not functioning. Here is the latest from the debug.log:
[02-Feb-2016 00:06:36 UTC] PHP Fatal error: Out of memory (allocated 34078720) (tried to allocate 52 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-content/plugins/essential-grid/includes/base.class.php on line 111 [02-Feb-2016 00:07:35 UTC] PHP Fatal error: Out of memory (allocated 34078720) (tried to allocate 52 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-content/plugins/essential-grid/includes/base.class.php on line 111 [02-Feb-2016 00:09:46 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:09:46 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:09:47 UTC] PHP Fatal error: Out of memory (allocated 32243712) (tried to allocate 28490 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/wp-db.php on line 1425 [02-Feb-2016 00:11:16 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:11:16 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:11:16 UTC] PHP Fatal error: Out of memory (allocated 32243712) (tried to allocate 24990 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/wp-db.php on line 1425 [02-Feb-2016 00:21:04 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:21:04 UTC] PHP Notice: Trying to get property of non-object in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/post.php on line 1591 [02-Feb-2016 00:21:05 UTC] PHP Fatal error: Out of memory (allocated 32243712) (tried to allocate 28490 bytes) in /homepages/20/d315350421/htdocs/PNW_HOST/new_site/chapters/wp-includes/wp-db.php on line 1425Which again shows Out of Memory errors. The Visual Composer page spins a gif that looks like it’s doing something, but of course it’s not. I did add the WP_MAX_MEMORY_LIMIT for good measure as well.
What should I try next? Does uninstalling and reinstalling the plugin make sense as it was just updated in the past week? Or is there a specific memory limit that can be adjusted just for wp-db.php? I know…grasping at straws.
Thank you for your help (seriously)!
Reinstalling Visual Composer would not help I’m afraid.
We need to find out what’s causing the memory limit to be stuck at 32M.
Do you run a plugin calledMemory Bumpmaybe? If so can you disable it temporarily?
Actually can you post a list of all your plugins so we can see if there’s any known for forcing a specific memory limit throughini_set?Another thing worth trying is to open your php.ini file (or create it if there isn’t any) and enter:
memory_limit = 256MSorry for the delay! I do not run Memory Bump, and here is the list that is listed on the subsite:
- Akismet
- Essential Grid
- flickrRSS
- Get The Image
- Hello Dolly
- NextGEN Gallery by Photocrati
- NextGEN Smooth Gallery
- Server IP & Memory Usage Display
- Simple Login Lockdown
- Slider Revolution
- TinyMCE Advanced
- U-Design Shortcode Insert Button
- WP-PageNavi
- WP125
- WPBakery Visual Composer
Should I download all of the plugin code and search for an ini_set call? Oh, and as for the php.ini looks like this:
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)I can increase it to 256M if you’d like, but they may not be necessary?
Thanks for sticking with it/me!
EDIT: Oh, and that Server IP & Memory Usage plugin may look like the immediate sore thumb, but that useful plugin has only been installed after the issues.
The only thing I could find is that the “Essential Grid” plugin recommends 256MB of RAM: http://www.themepunch.com/faq/how-to-increase-your-wordpress-memory/
You might want to change your
wp-config.phpto:define( 'WP_MEMORY_LIMIT', '256M' ); define( 'WP_MAX_MEMORY_LIMIT', '256M' ); ini_set( 'memory_limit', '256M' );as suggested, and also change
memory_limitfrom 128M to 256M in your php.ini file.
To be honest I’m not sure this will fix that 32M limit you’re seeing, but I guess we can only give it a try.BTW I’m reading a lot of *old* posts regarding 1&1’s 32MB PHP memory limit. It shouldn’t be the case any more with newer accounts, but is it possible this is a very old 1&1 account?
Actually, this is a quite old 1&1 account (at least 2012, probably older). It’s a developer account, which was their most expensive shared hosting plan at the time, but I can’t find any information in the Control Panel on how much RAM they have allocated to the package.
I like to believe that it’s not capped at 32M as the phpinfo.php page does report 128M in the Core section, but I suppose anything is possible. I will get in contact with their support to see if there is something that isn’t quite right with the server.
I will also increase the memory to 256 to appease the recommendation from Essential Grid — I believe that is a vital piece of the Visual Composer system, and that could be something that’s holding us back. I will definitely report back on that.
Oh, and finally, I did download all of the plugin files from the active server, and did a search for ini_set( …Found 22 occurrences across 12 files. The vast majority of which were from the NGGallery which is disabled, but there was one for Essential Grid as well. Hopefully, we’re on to something.
Thanks for the continued follow ups…otherwise I’d be lost here.
UPDATE: Contacted 1&1. Apparently, even though this was a developer package that cost over 22 bucks per month, since it was created back in 2010, the support tech said that I had a whopping 10MB of PHP memory. Even though phpinfo() reported otherwise, even though WordPress reported otherwise…The actual memory available on the system was far less than what was being shown.
Here’s the best/worst part of it — to fix this, they suggested I switch to a 15 dollar plan to get 128M of PHP memory. Which, hey, I like saving money, but still — what the heck was a paying for??? I’m going to save 7 bucks a month to get a better plan? What kind of a company is 1&1 that they happily take my 22 a month knowing full well that they are charging many other people far less and giving so much more.
Ok, rant over. I will report back to close this topic when I can confirm that the situation is fixed.
The topic ‘Incorrect Memory Allocation for subsite’ is closed to new replies.