Title: PHP errors: undefined variable, index
Last modified: April 20, 2017

---

# PHP errors: undefined variable, index

 *  Resolved [internationils](https://wordpress.org/support/users/internationils/)
 * (@internationils)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/)
 * [18-Apr-2017 05:52:14 UTC] PHP Notice: Undefined variable: rest_permalink in /
   srv/data/web/vhosts/mysite.de/htdocs/wp-content/plugins/varnish-http-purge/varnish-
   http-purge.php on line 422
    [18-Apr-2017 05:52:15 UTC] PHP Notice: Undefined 
   index: host in /srv/data/web/vhosts/mysite.de/htdocs/wp-content/plugins/varnish-
   http-purge/varnish-http-purge.php on line 330

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

 *  Plugin Contributor [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [8 years, 11 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9050706)
 * Thanks, I’ll get on these.
 * The second one is … interesting since that shouldn’t happen.
 *     ```
       		// If we made varniship, let it sail
       		if ( isset( $varniship ) && $varniship != null ) {
       			$host = $varniship;
       		} else {
       			$host = $p['host'];
       		}
       ```
   
 * The code `$host = $p['host'];` is the 330th line. It shouldn’t be an undefined,
   since you’re literally defining it there. I wonder if fixing the first will resolve
   the second.
 * The first is called because there’s no rest API URL for whatever it is you just
   edited. Do you happen to know what you were doing?
 *  Thread Starter [internationils](https://wordpress.org/support/users/internationils/)
 * (@internationils)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9050982)
 * I wasn’t doing anything, the only thing happening on the site on that day were
   automatic updates of plugins (slimstat, mailpoet newsletters). There were some
   downtimes on the hoster a few days ago as well (not sure what day), maybe that
   did something? I can’t think of anything else.
    Thanks for looking into this!
 *  Thread Starter [internationils](https://wordpress.org/support/users/internationils/)
 * (@internationils)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9050988)
 * Oh, and on the second one it’s complaining about the index (not the variable),
   so `$p['host']` isn’t defined…
 *  Plugin Contributor [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9334065)
 * This should be fixed.
 *  Thread Starter [internationils](https://wordpress.org/support/users/internationils/)
 * (@internationils)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9365873)
 * [29-Jul-2017 18:39:47 UTC] PHP Notice: Undefined index: host in /srv/data/web/
   vhosts/mysite.de/htdocs/wp-content/plugins/varnish-http-purge/varnish-http-purge.
   php on line 330
 * …just saw this again, with Version 4.1.1

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

The topic ‘PHP errors: undefined variable, index’ is closed to new replies.

 * ![](https://ps.w.org/varnish-http-purge/assets/icon-256x256.png?rev=3027185)
 * [Proxy Cache Purge](https://wordpress.org/plugins/varnish-http-purge/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/varnish-http-purge/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/varnish-http-purge/)
 * [Active Topics](https://wordpress.org/support/plugin/varnish-http-purge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/varnish-http-purge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/varnish-http-purge/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [internationils](https://wordpress.org/support/users/internationils/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/php-errors-undefined-variable-index/#post-9365873)
 * Status: resolved