If you are on a VPS or Dedicated server and you cannot see the changes to your PHP files when you update them, it is most likely caused by APC on your server or caching in your CMS (Content Management System) software. If you are using caching in your CMS you will need to consult the CMS develper on how to clear the CMS cache..

If you have APC installed on your server, you will need to wait the "TTL" time to see any changes to your PHP files. By default, the "TTL" settings are set to 1800 which is 30 minutes until the cache is refreshed. You can download the source code at the following link.

Viewing your APC cache settings

You can check the server APC php.ini settings by accessing your server using shell and running the following command:

grep apc /usr/local/lib/php.ini

When we setup APC on VPS and Dedicated servers, we use the following settings in the system php.ini:

[APC]
extension=apc.so
apc.enabled=1
apc.stat=0 ; set to 0 for a production site, 1 for development, will check files for recent updates
apc.shm_segments=1 ; dependant on hardware
apc.shm_size=32M ; dependant on hardware, 64M and above safe on dedicated servers
apc.ttl=1800
apc.user_ttl=1800
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.rfc1867 = 1
apc.filters = w3-total-cache-config

Here the apc.ttl=1800 is set to the 1800 or a 30 minute expire time. You can either wait for the time to elapse for the caching or you can clear your server cache.

Using apc.php to clear your server cache

You can use the existing apc.php file by copying it to your public_html directory. This gives you an interface where you can clear your APC cache from the server.

Copying your apc.php from your server.

The APC software comes with a dashboard where you can view and clear the current cache files. You will need to move the apc.php file to a public location so you can view it in your browser. Below are the steps the copy the apc.php file to a public location.

cp -p /usr/src/apc.php ~USER/public_html/
chown USER:USER ~USER/public_html/

Modify the file to add the user/pass to login on the page.

nano ~USER/public_html/

Make up a user and pass to login on the apc.php page. Then you will need to go to the location of the file in your site files. For example the url looks like the following.

http://your-domain.com/apc.php

You can then see more details and clear the cache.

Downloading an acp.php file online

If the apc.php file does not exist, the source code for the apc.php is found at the following URL.

http://pecl.php.net/get/APC

Make up a user and pass to login in the apc.php page code. Then you will need to go to the location of the file in your site files. For example the url looks like the following.

http://your-domain.com/apc.php

You will have a login page where you can log in and clear your APC cache.

If for whatever reason you cannot access the apc.php file or it is not working, please contact tech support and we can look into clearing the cache for you.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2220
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5642

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!