Title: PHP Warning: wp-cache-base.php on line 16
Last modified: November 3, 2016

---

# PHP Warning: wp-cache-base.php on line 16

 *  Resolved [ngrudev](https://wordpress.org/support/users/ngrudev/)
 * (@ngrudev)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/)
 * Hi,
 * After I disabled wordpress cron jobs and transfer them into the CPanel with 1
   hour interval, every time the cpanel cron job ran, this error is written in debug.
   log
 * [03-Nov-2016 04:00:03 UTC] PHP Warning: strpos(): Offset not contained in string
   in /home/lugabglj/public_html/bg_wp/wp-content/plugins/wp-super-cache/wp-cache-
   base.php on line 16
    [03-Nov-2016 05:00:04 UTC] PHP Warning: strpos(): Offset
   not contained in string in /home/lugabglj/public_html/bg_wp/wp-content/plugins/
   wp-super-cache/wp-cache-base.php on line 16 [03-Nov-2016 06:00:03 UTC] PHP Warning:
   strpos(): Offset not contained in string in /home/lugabglj/public_html/bg_wp/
   wp-content/plugins/wp-super-cache/wp-cache-base.php on line 16 [03-Nov-2016 07:
   00:03 UTC] PHP Warning: strpos(): Offset not contained in string in /home/lugabglj/
   public_html/bg_wp/wp-content/plugins/wp-super-cache/wp-cache-base.php on line
   16 [03-Nov-2016 08:00:03 UTC] PHP Warning: strpos(): Offset not contained in 
   string in /home/lugabglj/public_html/bg_wp/wp-content/plugins/wp-super-cache/
   wp-cache-base.php on line 16 [03-Nov-2016 09:00:04 UTC] PHP Warning: strpos():
   Offset not contained in string in /home/lugabglj/public_html/bg_wp/wp-content/
   plugins/wp-super-cache/wp-cache-base.php on line 16
 * Is this a bug and how to fix it? Thank you.
 * Niki
    -  This topic was modified 9 years, 7 months ago by [ngrudev](https://wordpress.org/support/users/ngrudev/).

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

 *  [doug wilson](https://wordpress.org/support/users/dgswilson/)
 * (@dgswilson)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/#post-8391730)
 * You could reset all that and use CometCache. I finally gave up trying to get 
   SC running on one server where I have a tube site.
 *  Thread Starter [ngrudev](https://wordpress.org/support/users/ngrudev/)
 * (@ngrudev)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/#post-8395970)
 * I like WP SC and don’t want to change it only for one stupid notice in debug.
   log.
 * The code in wp-cache-base.php is as follows:
 *     ```
       <?php
       $known_headers = array("Last-Modified", "Expires", "Content-Type", "Content-type", "X-Pingback", "ETag", "Cache-Control", "Pragma");
   
       $WPSC_HTTP_HOST = htmlentities( $_SERVER[ 'HTTP_HOST' ] );
   
       // We want to be able to identify each blog in a WordPress MU install
       $blogcacheid = '';
       if ( defined( 'VHOST' ) || ( defined( 'WP_ALLOW_MULTISITE' ) && constant( 'WP_ALLOW_MULTISITE' ) == true ) ) {
       	$blogcacheid = 'blog'; // main blog
       	if( defined( 'SUBDOMAIN_INSTALL' ) && constant( 'SUBDOMAIN_INSTALL' ) == true ) {
       		$blogcacheid = $WPSC_HTTP_HOST;
       	} else {
       		if ( isset( $base ) == false )
       			$base = '';
       		$request_uri = str_replace( '..', '', preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', $_SERVER['REQUEST_URI'] ) );
       		if( strpos( $request_uri, '/', 1 ) ) {
       			if( $base == '/' ) {
       				$blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 );
       			} else {
       				$blogcacheid = str_replace( $base, '', $request_uri );
       				if ( $blogcacheid != '' )
       					$blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) );
       			}
       			if ( '/' == substr($blogcacheid, -1))
       				$blogcacheid = substr($blogcacheid, 0, -1);
       		}
       		$blogcacheid = str_replace( '/', '', $blogcacheid );
       	}
       }
   
       ?>
       ```
   
 * The “bad” line is:
 *     ```
       		if( strpos( $request_uri, '/', 1 ) ) {
       ```
   
 * Probably this line is not written perfectly corect.
 *  Thread Starter [ngrudev](https://wordpress.org/support/users/ngrudev/)
 * (@ngrudev)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/#post-8397399)
 * I resolved it. It wasn’t problem with Wp Super Cache. Because I’ve stopped WP
   cron jobs and transfer them in CPANEL cron job, I am starting the cron through
   manual execution file. For some reasons because of this approach $_SERVER[“REQUEST_URI”]
   returns blank, which is the problem.
 * I resolved it with manually set of $_SERVER[“REQUEST_URI”] to “/”
 * $_SERVER[“REQUEST_URI”] = array_key_exists( ‘REQUEST_URI’, $_SERVER) ? $_SERVER[‘
   REQUEST_URI’] : “/”;
 * Hope this will help those, who are disabled WP cron jobs, and make it in CPANEL.
 *  [stevenjay2014](https://wordpress.org/support/users/stevenjay2014/)
 * (@stevenjay2014)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/#post-8683164)
 * $_SERVER[“REQUEST_URI”] = array_key_exists( ‘REQUEST_URI’, $_SERVER) ? $_SERVER[‘
   REQUEST_URI’] : “/”;
 * Did You Add this to the bottom of the wp-cache-base.php ?

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

The topic ‘PHP Warning: wp-cache-base.php on line 16’ 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/)

## Tags

 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 4 replies
 * 3 participants
 * Last reply from: [stevenjay2014](https://wordpress.org/support/users/stevenjay2014/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/php-warning-wp-cache-base-php-on-line-16/#post-8683164)
 * Status: resolved