Karwalski
Karwalski

Reputation: 69

Server side PHP page cache troubleshoot

I have been searching for further troubleshooting info on server side caching, however can only find info relating to using PHP to cache common elements.

I have a wordpress install, with WP_cache set to false. No CDN or Wordpress caching plugins.

I had an error in one .php file which was being called via the php include. The error was a missing / in the directory name with the PHP function move_uploaded_file() - In turn it was pointing to a non existing folder.

I have been developing on this server (OpenBSD, Apache 2.2, PHP 5.4) for a few weeks with no issues deleting and replacing php files, the new php pages would be processed instantly.

Now, the file with the error equipment.php is displaying the outputs of the .php page at the time of the error, I have replaced (and double checked server) and even deleted the page and it still shows the old php output.

I have a work around to change the includes to equipment2.php and rename the page - this worked.

The php logs show the error with the original function and also the missing equipment.php when I delete the file (despite php outputs being served). I have no access to php.ini to increase verbose. I am unable to restart Apache on the server.

I suspect the server is running some kind of caching or the PHP stored and serves an old version of the php page after certain errors.

Please assist with troublshooting for server side caching.

Upvotes: 0

Views: 316

Answers (1)

Ihor Vorotnov
Ihor Vorotnov

Reputation: 1807

Probably it's caused by PHP's OPcache. Reload your PHP engine to clean the cache, or, if you don't have root access to the server, use this plugin:

https://wordpress.org/plugins/opcache/

After activation, find your file on the plugin's page and delete it from cache.

Upvotes: 1

Related Questions