How to Enable Admin Script of APC on PHP

On the previous post, i had shows how to enable APC with PHP on CentOS 6.3. This post will covers the steps to enable admin script of APC. The Alternative PHP Cache (APC) is a free, open, and robust framework for caching and optimizing PHP intermediate code. It’s an PECL extension which shares the packaging and distribution system with its sister, PEAR.

1. Create directory apc on document root :

[root@centos63 ~]# mkdir /var/www/html/apc

2. Copy apc.php from php-pecl-apc folder to document root :

[root@centos63 ~]# cp /usr/share/doc/php-pecl-apc-*/apc.php /var/www/html/apc

3. Create new file name apc.conf.php :

[root@centos63 ~]# vi /var/www/html/apc/apc.conf.php
<?php
   defaults('ADMIN_USERNAME','apcadmin');
# set any username

   defaults('ADMIN_PASSWORD','apcadmin');
# set any password

?>

4. Create new file name apc.conf :

[root@centos63 ~]# vi /etc/httpd/conf.d/apc.conf
<Directory /var/www/html/apc>
   Order Deny,Allow
   Deny from all
   Allow from 127.0.0.1 192.168.1.0/24
# IP address you allow

</Directory>

5. Restart Apache httpd :

[root@centos63 ~]# /etc/rc.d/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

6. Navigate the browser to http://servername/apc/apc.php and it will shown as below :
Apc

Leave a Reply

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

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee