• 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

How to clear apc cache by using php script

August 29, 2014 by Sharad Chhetri 1 Comment

In this post we will learn, how to clear apc cache by using php script. A few days back, one of the reader of our blog asked a question. It was about how to clear php APC cache.The question was asked on our previous post on PHP APC error.

Follow the given below steps to clear apc cache

Here in this section we will create a php script called clear_apc.php . With this script , it will clear the APC cache.

Basically we are using apc_clear_cache() function in PHP script. (Reference: apc_clear_cache )

Step 1: Login to your server. And create a file inside web root directory on your server.

On my server the Web root is at /var/www/html/sharadchhetri_blog . It may be different on your server.

Create a file called clear_apc.php
Replace 192.168.56.101 with your server ip address in below given script’s content.

vi clear_apc.php

And paste below given contents.

 true));
}
else
{
  die('No valid IP');
}
?>

Step 2: Change the permission of script . Make the file clear_apc.php executable

chmod 700 clear_apc.php

Step 3: Now execute the script by using below wget command .

Replace https://sharadchhetri.com with your website URL

Example. from our site

wget -O - -q https://sharadchhetri.com/clear_apc.php

This will clear the php apc cache.

Note: If wget command not found then install it. (RHEL/CentOS: yum install wget , Ubuntu/Debian : sudo apt-get install wget)

Share this:

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

Related posts:

  1. php 5.5 APC : ERROR: `make’ failed
  2. Linux : clear command and its keyboard shortcut
  3. How to hide php version information in header
  4. Increase upload file size limit in php
  5. PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0
  6. Install and configure Varnish Cache server on CentOS/RHEL 6.x
  7. Setup varnish cache server for wordpress site
  8. How to setup Varnish to do not cache particular url specific domain
  9. How to setup varnish to do not cache particular url
  10. Install php 5.4 on CentOS 6 with yum command

Filed Under: Apache Tagged With: apache, apc, php

Reader Interactions

Comments

  1. cole says

    March 5, 2018 at 10:57 am

    Hey,

    I just want to say you’re a god send ๐Ÿ™‚

    Regards,

    Cole

    Reply

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

curl command to check the http status

sed: -e expression #1, char 24: Invalid range end

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Learn Linux Date Command With Examples

How to convert rpm file into deb file

WordPress host IP changed not able to open wp-admin and site page looks scattered

Allow only members of Wheel group to use su command on RHEL/CentOS

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