A lot of PHP Warning errors until I could not logon on my forum

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Support Request Template
What version of phpBB are you using? phpBB 3.2.2
What is your board's URL? www.itlearning.ro/forum
Who do you host your board with? hostvision.ro
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What version of phpBB3 did you update from? phpBB 3.0.12
What extensions do you have installed? Tapatalk
What styles do you currently have installed? prosilver
What language(s) is your board currently using? romanian
Which database type/version are you using? MySQL 5
What is your level of experience? New to PHP and phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I don't know if this could be considered an upgrade, because Instruction followed were from here https://www.phpbb.com/support/docs/en/3 ... /upgrade3/ so only the database was updated to the last version, and I have used the files, images and store folders and the only php file used from the old forum was config.php.

The old 3.0.12 was functioning without any problems on current provider and current PHP settings.
Please describe your problem. A lot of PHP Warning errors even I clear cache. It works for couple of days and then the errors start again.
Today I even could not login anymore until I login into cPanel account and rename the cache/production folder so it was creating a new one automatically.

When I lost the logon ability the errors were the following:

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/common.php on line 140: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/composer/ClassLoader.php on line 412: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/ucp.php on line 21: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/ucp.php on line 22: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/includes/utf/utf_tools.php on line 1328: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/includes/utf/utf_tools.php on line 547: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/includes/utf/utf_tools.php on line 553: include(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/class_loader.php on line 160: require(): Unable to allocate memory for pool.
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1836: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3268)
Generated by SRT Generator
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by Brf »

luconsta wrote: Tue Sep 04, 2018 5:00 pm Unable to allocate memory for pool.
That is all the same error. It says your server is not allocating enough memory for phpBB 3.2.
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Thank you brf for your message, but what is different from the "good old" 3.0.12 that does not "fit" on the same server with this new 3.2.2 version?
Or why this is mostly related to clearing the cache folder one day or other?
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by thecoalman »

A quick Google search suggests this error is related to APC which is an older caching system for PHP. To determine if APC is installed open phpBB's ACP(this could get confusing LOL) and go to the system tab >> php information link on the left. Search that page for APC.

Same Google search suggests the settings for APC might need some tweaking, Optionally PHP now has built in caching with OPcache, I've been using it without issue.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Thank you thecoalman for your message. Indeed I have APC an here are the settings:

Code: Select all

apc
APC Support	enabled
Version 	3.1.13 
APC Debugging 	Disabled 
MMAP Support 	Enabled 
MMAP File Mask 	/dev/zero 
Locking type 	pthread mutex Locks 
Serialization Support 	php 
Revision 	$Revision: 327136 $ 
Build Date 	Aug 26 2018 10:46:29 


Directive	Local Value	Master Value
apc.cache_by_default	On	On
apc.canonicalize	Off	Off
apc.coredump_unmap	Off	Off
apc.enable_cli	Off	Off
apc.enabled	On	On
apc.file_md5	Off	Off
apc.file_update_protection	2	2
apc.filters	no value	no value
apc.gc_ttl	3600	3600
apc.include_once_override	Off	Off
apc.lazy_classes	Off	Off
apc.lazy_functions	Off	Off
apc.max_file_size	1M	1M
apc.mmap_file_mask	/dev/zero	/dev/zero
apc.num_files_hint	1024	1024
apc.preload_path	no value	no value
apc.report_autofilter	Off	Off
apc.rfc1867	Off	Off
apc.rfc1867_freq	0	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_	upload_
apc.rfc1867_ttl	3600	3600
apc.serializer	default	default
apc.shm_segments	1	1
apc.shm_size	32M	32M
apc.shm_strings_buffer	1M	1M
apc.slam_defense	On	On
apc.stat	On	On
apc.stat_ctime	Off	Off
apc.ttl	7200	7200
apc.use_request_time	On	On
apc.user_entries_hint	4096	4096
apc.user_ttl	7200	7200
apc.write_lock	On	On
Can you help me "tweak" or change the phpBB or PHP settings to use OPcache?
Or maybe someone could post his/her board APC functional settings?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26508
Joined: Fri Aug 29, 2008 9:49 am

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by Mick »

The simplest solution would be to ask your host to allocate more memory.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Hello Mick and thank you for your message, but could you be more specific - which parameter should be changed and what value should have. I could tell the provider but I have to tell them exactly and also to verify afterwards if they really set the correct value... ;)
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26508
Joined: Fri Aug 29, 2008 9:49 am

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by Mick »

If you Google search “Unable to allocate memory for pool” there are plenty of suggestions how to tackle the issue from manually changing php.ini, if you have access, or getting your host to do it. Basically APC is out of memory so if you show them the error they should know what to do.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

So Mick, with other words you say that starting with the new 3.2.2 version I have to learn how to tweak more on the PHP settings?... or is better to revert back to the older verison 3.0.12 that was functioning without any problem? I've just upgraded only because security concerns and be "updated"... but now I have only usage concerns... :P

Meanwhile, I have followed the thecoalman suggestion and disabled APC and enabled OPCache... so I'll see what will happens on the next couple of days... :roll:
User avatar
Leinad4Mind
Translator
Posts: 863
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by Leinad4Mind »

This problems are from modSecurity. If you disable it, it will work without problems.

But your host should optimize modSecurity to work flawlessly with phpbb. You should ask them.

How do I know if I am using ModSecurity?
Administration Control Panel > PHP Information. If your web server is Apache, search for “apache2handler” and look at the loaded modules. Scan for “mod_security” or “mod_security2”. If it’s there, it’s enabled. If you can view your web server error log, scan it for “mod_security”. If you find it, it’s enabled. You can also ask your web host if they have it enabled for your site.

How do I know if ModSecurity is the culprit?
You should disable it and if the problems goes away then you have it.

How do I turn off ModSecurity for my domain?
Look in your web host control panel. If there is a security section, there may be a feature there to enable or disable ModSecurity. Disable it if you can find it. You may have to ask your web host.

Is it safe to disable ModSecurity?
Perhaps not but you may not be able to have anyone access your forum unless you disable it. Most likely ModSecurity’s rules are not optimally written to accommodate phpBB forums. And you should ask your host to optimize it if thats the case.

Can I disable ModSecurity just inside my forum and leave it enabled on the rest of my website?
Perhaps. Try adding this to the top or bottom your forum’s .htaccess file. If the problem goes away, you are done! (The IIS web server does not use the .htaccess file.)

Code: Select all

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>
How does ModSecurity cause problems with phpBB?
It appears that ModSecurity and phpBB don’t get along very well. These problems may be occurring because the web host added it or turned it on for you and didn’t tell you. ModSecurity can generate various application errors causing the behavior of phpBB to change. In one recent example, when a admin tried to click on the Administration Control Panel link, he was redirected to his website homepage instead. Disabling ModSecurity solved his problem.

Here are some other symptoms caused by ModSecurity intercepting and redirecting web traffic that admins experienced recently:
  • In phpBB 3.2, the Viglink and share forum statistics screen come up in the Administration Control Panel by default after you update to that version. There are checkboxes that allow you to uncheck these. In this case unchecking these and submitting the form generated an unfriendly error message: “Unused” and reported an internal error. This made it impossible to get to the General tab and do things like purge the cache.
  • A forum would not come up at all. Only a white screen appeared. Disabling ModSecurity solved the problem. Note: other issues can cause this, including malware or syntax errors introduced into your forum’s phpBB code.
  • In phpBB’s /cache/production folder, files are created by phpBB with an “autoload_” prefix. These were getting deleted outside of phpBB, triggering PHP warnings. Turning off ModSecurity caused the problem to go away (after purging the cache).
Some of this post info was based on phpbbservices.com blog, thanks to them for simplifying my explanation.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by thecoalman »

As Mick noted contact your host. The configuration for this likely can't be changed by you.
Mick wrote: Wed Sep 05, 2018 7:33 am The simplest solution would be to ask your host to allocate more memory.
Based on what I read that may not necessarily be the case with this error if it's APC because the RAM is being consumed by incorrect configuration settings or possibly other issues.
Leinad4Mind wrote: Wed Sep 05, 2018 10:19 am How do I know if ModSecurity is the culprit?
You should disable it and if the problems goes away then you have it.
I use mod_security with the default OWASP ruleset from Cpanel without any issues however no harm in temporarily disabling it to test it. If it is the cause leave it disable and contact your host. They would nee to disable the rule causing the issue.
In phpBB’s /cache/production folder, files are created by phpBB with an “autoload_” prefix. These were getting deleted outside of phpBB, triggering PHP warnings. Turning off ModSecurity caused the problem to go away (after purging the cache).
These files for example are present in my cache folder, dated from yesterday morning which was last time I purged the cache.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by thecoalman »

luconsta wrote: Wed Sep 05, 2018 10:03 am Meanwhile, I have followed the thecoalman suggestion and disabled APC and enabled OPCache... so I'll see what will happens on the next couple of days... :roll:
You were able to do that from the control panel or the php.ini? The APC settings should no longer appear under phpBB's system tab >> php information link and the OPcache settings should now appear.

I'm surprised you would have this option on shared host, one thing to note is OPcache needs enough RAM to hold all your scripts and there is another setting for max files. If they are not high enough this can cause performance issues or you possibly might start getting same error. You can use this script to check the status:

https://github.com/rlerdorf/opcache-status

The scripts are loaded into RAM as they are first used so if nothing has called the script it wont be consuming resources until it is. Keep an eye on the status for while because it will climb until all the scripts are loaded. Also there is one configuration to adjust for better performance.

Code: Select all

opcache.validate_timestamps=0
Look it up. Briefly once the script is loaded into RAM OPcache will no longer check to see if the script has been updated with this set to 0. The one big issue with this is if you upload a new version of a file it won't be updated in the cache. Conveniently when you purge the cache from phpBB's ACP this will also purge OPcache's cache. ;)
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Thank you Leinad4Mind for your message, I will have to dig more because either I don't have apache or this security module because I have search all the keywords "apache" or "secur" and did not find anything.

To the thecoalman - I guess I'm lucky and some parts of the PHP I cold configure in my cPanel so I could disable APC and enable opcache. 8-)
Disable APC and enable OPCACHE.jpg

After this change, the APC section dissapeared from the ACP=>General=>PHP Information, so it seems to react to my changes, but I will be sure were usefull changes after couple of days.
User avatar
Leinad4Mind
Translator
Posts: 863
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by Leinad4Mind »

I saw you're using PHP 5.4, beware that phpBB 3.2 needs at least 5.4.7 ;)

So I recommend you to change to 5.6 or if possible go to 7.0+ (phpBB 3.2 already supports 7.2)
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
luconsta
Registered User
Posts: 27
Joined: Thu Sep 24, 2009 3:03 pm

Re: A lot of PHP Warning errors until I could not logon on my forum

Post by luconsta »

Leinad4Mind wrote: Wed Sep 05, 2018 11:59 am I saw you're using PHP 5.4, beware that phpBB 3.2 needs at least 5.4.7 ;)
Thank you for mentioning, I have checked my PHP version and it seems to be 5.4.45 so it should be ok.
Post Reply

Return to “[3.2.x] Support Forum”