• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

June 30, 2014 by Sharad Chhetri Leave a Comment

It was shiny morning and at the time of taking tea at home. I opened my laptop and login into my server. Recently, I changed the apache MPM to worker mode. Running php-fpm and mod_fcgi to run the WordPress based blog.

After a few days of Worker apache implementation, I checked the php-fpm log directory and found some error that is

[root@mysites php-fpm]# tail www-error.log
[26-Jun-2014 13:39:34] PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0
[26-Jun-2014 13:48:00] PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

To solve this issue, I optimize the php apc.

In CentOS/Red Hat and Scientific Linux, the absoute path of apc.php is /etc/php.d/apc.php

I optimizes mainly these 4 values –

apc.shm_size
apc.num_files_hint
apc.user_entries_hint
apc.ttl

Optimizing the PHP apc takes time, I need some monitoring and playing around with these above 4 values.

I am sharing my apc.ini file which is working for me.
Note: Detailed description on below given egrep command

[root@mysites php.d]# egrep -v '^;|^$' apc.ini
extension = apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128M
apc.num_files_hint=20000
apc.user_entries_hint=20000
apc.ttl=7200
apc.use_request_time=1
apc.user_ttl=7200
apc.gc_ttl=3600
apc.cache_by_default=1
apc.filters
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.file_update_protection=2
apc.enable_cli=0
apc.max_file_size=20M
apc.stat=1
apc.stat_ctime=0
apc.canonicalize=0
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=0
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
apc.include_once_override=0
apc.lazy_classes=0
apc.lazy_functions=0
apc.coredump_unmap=0
apc.file_md5=0
apc.preload_path
[root@mysites php.d]# 

Restart the apache and php-fpm

service httpd restart

service php-fpm restart

Visual Dashboard of PHP APC status

The PHP apc comes with awesome dashboard.

Copy apc.php file into DocumentRoot of your website. Replace /var/www/html/website-name with your website DocumentRoot

cp /usr/share/php-pecl-apc/apc.php /var/www/html/website-name

Change the password of apc dashboard.
Here default username s apc.

Find the below given line in apc.php file which you have copied into website DocumentRoot. Change the password.

defaults('ADMIN_USERNAME','apc');                       // Admin Username
defaults('ADMIN_PASSWORD','password');          // Admin Password - CHANGE THIS TO ENABLE!!!

Restart Apache and php-fpm once again

service httpd restart

service php-fpm restart

The below given is the reference from my live server. Still I am monitoring and optimizing the PHP APC. Right now error is gone and I marked it as solved.

php apc

PHP APC Documentation

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to free pagecache, dentries and inodes from memory on linux
  2. Nagios HTTP WARNING: HTTP/1.1 403 Forbidden
  3. SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
  4. WARNING: getfattr not found, certain checks will be skipped
  5. check_memory unable to read output Nagios nrpe
  6. Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/Latest/
  7. Unable to complete install:’unsupported configuration hda-duplex not supported in this Qemu binary’
  8. WordPress error “Unable to create new image”
  9. Show visitor ip address php code
  10. php 5.5 APC : ERROR: `make’ failed

Filed Under: Apache, Linux Tagged With: php

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

How to reset forgot root password in CentOS 6.x and Redhat 6.x

Yum Error database disk image is malformed

Allow wget and yum in iptable

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

df command not showing correct free space in linux

safest method to remove softlink in linux

error command ‘gcc’ failed with exit status 1 in Ubuntu

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy