I've recently had an issue with my Wordpress (version 5.5 on Ubuntu 18.04, PHP 7.2) website which meant I needed to restore from a backup and debug.
I restored an alternative version of one of my PHP pages from my dev site and executed it in the browser - it worked as expected and through the debugging console I realised where my issue was and went ahead and fixed it in the latest version of the file.
I then copied the "newest" PHP back into the directory and ran it in the browser. The browser is still loading the "old" PHP page.
I assumed it was a caching issue, so I've cleared browser cache, tried different browsers, even different clients, disabled all caching plugins in Wordpress, restarted apache, confirmed Opcache is disabled, renamed the file - and as a last resort even removed the PHP file completely, and yet it still loads the old version in the browser!
Is there another server side caching mechanism I've overlooked?
-- EDIT -- I should add that I don't use a CDN either
Related
this question is similar to: disable php files caching for debugging
Currently, I try to debug a PHP website but I discover that there is some cache problem. When I update a PHP file, the update may or may not be available right now. I even deleted the index.php and the Website was still working.
This is not a browser cache problem because I use Chrome Incognito + Chrome Developer with "Disable Cache" checked + "Empty cache and Hard reload".
I think the problem come from the fact that PHP were upgraded to 7.3.XX (from 5.X) and there's a OPcache module enabled by default.
Is there a way to ignore this module. This website is on a shared hosting plan so I may not be able to edit config files.
EDIT: OPcache was not activated in the Cpanel. I also downgrade to PHP 5.6 and the problem is still here.
New observation: Before the PHP downgrade, I got a info.php file that print the phpinfo(). It was and is still showing 7.3 as version (cache?). I created a copy of that file and named it info2.php. This one is showing 5.6 as as PHP version. So there is still a cache somewhere.
Also, is this possible that the .htaccess file is also cached?
If your hoster has enabled user.ini files you can drop an ini file in your project directory containing:
opcache.enable=0
PHP Manual - Opcache config
I am using NetBeans 8.0.2 firefox 37.0.1, WAMP 2.5(php develpoment).
I am using the "Copy files from Source folder to another location" feature which copies the development files to the WAMP directory.
My problem is that whenever I hit run, I get cached version and only after I hit refresh in browser, I get the latest version.
This complicates the development process.
I have tried disabling Firefox cache using this
and tried disabling apache caching using this.
But neither worked. Any help would be appreciated.
I'm hoping someone can help me with this, as I've kinda hit a wall. Here's the situation:
I'm currently setting up a knowledge base using MediaWiki. I'm using XAMPP to aggregate my tools. The site itself is working fine, and coming along nicely.
I'm now trying to set up a cache to speed things up. I've opted to use PHP APC, as it is recommended for MediaWiki. The troubles started here.
Current versions are:
PHP: 5.4.4
Apache: 2.4.2 (apache2handler)
SQL: 5.5.25a
XAMPP: 1.8.0
MediaWiki 1.19.1
I am currently using Windows, so the first issue I had was finding the correct php_apc.dll file for my PHP. I tried numerous versions unsuccessfully (with log errors stating the .dll cannot be found). I eventually was able to secure a version which seems to work, APC 3.1.14 for PHP 5.4, downloaded from http://dev.freshsite.pl/php-accelerators/apc.html. It is the TS version, as this option is enabled on my PHP.
Now, with this presumably correct version of APC, Apache is now able to start fine. phpinfo() also shows the APC extension as available. The problem is now that no pages on the wiki will load. Precise situation is that:
All pages on the Wiki do not load (IP/mediawiki/*)
Pages on XMAPP itself do seem to load correclt (IP/XAMPP/*).
Other utilities are not able to load either, (e.g. phpMyAdmin).
No error messages seem to be created either in apache logs or php logs. Now, I am by no means an expert on this.
I have confirmed that environment variables in Windows TMP and TEMP both point to the same folder (C:\WINNT\TEMP), on which I gave "everyone" full access rights.
Here is an image showing the phpinfo() for APC that I can see:
http://i.stack.imgur.com/hYHwP.png
Any ideas?
edit: I forgot to mention: there actually are 0kb sized files that seem to be related to APC being created under c:\winnt\temp. For instance, one of them is called ".apc.a02684".
This has come up previously on the MediaWiki Support Desk. MediaWiki apparently doesn't run under Apache 2.4.
I had difficulty finding the newest version of php_apc.dll so I went ahead and compiled it myself. I had no issue getting it compiled using NTS v5.3.8. I had two separate files set up to test, one with a simple phpinfo() call on it and the other being the standard apc.php file that comes with the apc source files.
Strangely, when I would load the phpinfo() file it would work totally fine, but when I tried to access apc.php the webserver would hang until a timeout. I restarted the webserver, accessed apc.php and it worked just fine, but trying to go back to phpinfo() would cause the server to hang until timeout. It is probably worth noting that phpmyadmin and my own codeigniter application do not work period, even after a restart.
I have tried previous versions of apc with no luck; 5.3.5 with apc.stat = 0 works but I am in need of that feature as this is a development server, but I'm testing out some production type caching.
Noteworthy stuff:
Server is powered by Nginx 1.0.8 running PHP 5.3.8 (using fast-cgi). Everything works as intended with the exception of when apc is loaded.
You can download the php_apc.dll from http://downloads.php.net/pierre/
You can find there different versions of it.
I've been experiencing a safari problem while building a web application. The screen goes completely blank (white) and refreshing won't help. Going to another page on the site gives the same problem. Then magically, after a little while, everything goes back to normal and pages are rendered correctly!
This started happening around the same time that I SUSPECT my hosting automatically upgraded from PHP 5.2.x to 5.3 (all of a sudden, we got 'deprecated function' errors and the error settings and handling were unchanged)
I also have to mention that this doesn't happen in our dev environment (PHP 5.2.9, Apache 2)
Settings
Safari 4.0.2 and the latest one (don't know the version)
Server side: PHP 5.3, MySQL 5.0.90, Apache is cPanel Easy Apache v3.2.0
Does anyone know why this is happening at all or know how to fix it?
If it happens with other browsers as well as safari it is probably an error message generated but not displayed. Depending on your code these can be time dependent.
If you have an error log file on your server check it's content.
You should also set up a PHP 5.3 development environment as quickly as possible. There are things that can go wrong when upgrading from 5.2. to 5.3 (see this page and yes, you can get angry at your provider, the PHP site does not advice an upgrade without a code check).