Title: PHP Notice: Undefined variable:
Last modified: May 23, 2019

---

# PHP Notice: Undefined variable:

 *  [Cris](https://wordpress.org/support/users/crispaor/)
 * (@crispaor)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/)
 * Hi,
 * I’ve got this:
    [21-May-2019 19:01:24 UTC] PHP Notice: Undefined variable: tmp_wpcache_filename
   in /srv/www/__.org/www/wp-content/plugins/wp-super-cache/wp-cache-phase2.php 
   on line 1121
 * What does it mean?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11566548)
 * Can you also check in wp-admin folder, if you have a stray .php file (only with.
   php extension) ?
 *  Thread Starter [Cris](https://wordpress.org/support/users/crispaor/)
 * (@crispaor)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11567400)
 * I haven’t that file.
    -  This reply was modified 7 years ago by [Cris](https://wordpress.org/support/users/crispaor/).
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11568481)
 * The “.php” file should be in wp-content/cache/ but in my testing I couldn’t see
   it. Not sure why. The bug is harmless but I’ll fix it. Thanks for reporting it
   [@crispaor](https://wordpress.org/support/users/crispaor/).
 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11568530)
 * Harmless ?
 * [https://wordpress.org/support/topic/wp-super-cache-created-a-stray-php/](https://wordpress.org/support/topic/wp-super-cache-created-a-stray-php/)
 * Security plugins send alerts and i spend hours trying to figure out if i’m hacked
   and how.
 * Also not sure it is harmless, since there are other areas that also break.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11568780)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) – It created
   an empty file called “.php” which couldn’t do anything, but I’m sorry if you 
   were worried. There was no danger to your site.
 * What “other areas that also break” are you referring to? I’d like to get a new
   release out that fixes this but I’ll address those too if possible.
 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11568806)
 * I don’t follow. You already said that the file should be in “wp-content/cache/”
   but it was in “wp-admin”. Isn’t that kind of strange ?
 * Also what is a file with just an extension ? A mystery ? An error ?
 * Other areas break ? Sure, but i have already highjacked this topic. I will continue
   to an other topic.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11568894)
 * It was the php rename() function working as it should:
 * `rename( $tmp_config_filename, $tmp_wpcache_filename . ".php" );`
 * The unidentified variable “tmp_wpcache_filename” should have been the path+filename
   of a temporary file in the cache folder but it’s not set so it’s “”.
    The rename
   command was told to rename the empty file $tmp_config_filename to “.php” in the
   current working directory. Since you’re using the settings page the current working
   directory is “wp-admin” and that’s where the .php file was created.
 * What I said above was before I thought through what it was doing and was wrong.
 *  [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11570048)
 * Ok, crystal clear now what happens.
 * The second problem i mentioned by “breaks the website” apparently is related 
   to the same error. What happens is if i delete the debug.log (to see if WP Super
   Cache complains again), the debug.log is recreated as before for some reason 
   with the old debug details. And old timestamp. Something is very wrong in all
   this, so i’m back to 1.64.
 * Thanks
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11575217)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) – that’s expected.
   The files are recreated with the same credentials because it’s simpler to create
   the file once, with the PHP required for the http auth. There’s no logging done
   to the file until debugging is enabled.
 * When you click the delete button the log and view files are recreated so the 
   timestamp of the files should have changed. That’s what happens when I test it.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP Notice: Undefined variable:’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/php-notice-undefined-variable-13/#post-11575217)
 * Status: not resolved