Title: Not creating cache folder
Last modified: December 3, 2016

---

# Not creating cache folder

 *  [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/)
 * This looks like a great plugin, but I can’t get it to function. The first time
   I ran it, then checked my site, no images loaded at all!
 * A quick look around determined that the custom cache folder hadn’t been created.
   Obviously, this must mean that the plug-in is trying to serve images from a location
   that doesn’t exist, so… I checked the debug and I *have* tried to access the 
   site from a mobile device, so the third line is making an incorrect (though fair)
   assumption.
 * My wp-content folder is in the “default” location as specified in the documentation
   i.e. “inside the root directory of the WordPress installation, along with /wp-
   admin and /wp-includes”
 * ✔ PHP GD library is installed.
    ✖ Image cache directory has not been created.
   But this is probably because the cache has not been accessed yet. After accessing
   your website from a mobile device the directory should be automatically created.
 * /var/www/vhosts/moshville.co.uk/Moshville/wordpress/wp-content/cache => drwxr-
   xr-x
    ✔ Installation .htaccess file is setup OK. /var/www/vhosts/moshville.co.
   uk/Moshville/.htaccess => -rw-r–r– ❖ Adaptive images settings dump: array(12){[“
   resolutions”]=> array(3) { [0]=> int(1024) [1]=> int(640) [2]=> int(480) } [“
   cache-directory”]=> string(21) “cache/adaptive-images” [“watched-directories”]
   => array(2) { [0]=> string(18) “wp-content/uploads” [1]=> string(17) “wp-content/
   themes” } [“jpeg-quality”]=> int(65) [“sharpen-images”]=> bool(true) [“watch-
   cache”]=> bool(true) [“browser-cache”]=> float(180) [“landscape”]=> bool(false)[“
   hidpi”]=> bool(false) [“cdn-support”]=> bool(false) [“version”]=> string(6) “
   0.6.60” [“sanitized”]=> bool(true) }
 * Web Server
    Apache Document Root /var/www/vhosts/moshville.co.uk/Moshville PHP
   5.6.28 PHP Time Limit 30 PHP Memory Limit 256M PHP Post Max Size 110M PHP Upload
   Max Size 100M PHP Max Input Vars 1000 PHP Display Errors Yes PHP Error Log MySQL
   5.6.34-log MySQL Ext/mysqli Yes MySQL Table Prefix wp_moshville_ MySQL DB Charset
   utf8 WP 4.6.1 WP Multisite No WP Debug Mode No WP Site url [http://www.moshville.co.uk/wordpress](http://www.moshville.co.uk/wordpress)
   WP WP Home url [http://www.moshville.co.uk](http://www.moshville.co.uk) WP Permalinks/%
   category%/%year%/%monthnum%/%postname%/ WP home path /var/www/vhosts/moshville.
   co.uk/Moshville/ WP content dir /var/www/vhosts/moshville.co.uk/Moshville/wordpress/
   wp-content WP plugin dir /var/www/vhosts/moshville.co.uk/Moshville/wordpress/
   wp-content/plugins WP content url [http://www.moshville.co.uk/wordpress/wp-content](http://www.moshville.co.uk/wordpress/wp-content)
   WP plugin url [http://www.moshville.co.uk/wordpress/wp-content/plugins](http://www.moshville.co.uk/wordpress/wp-content/plugins)
   WP Locale en_GB WP Memory Limit 128MB WP Max Upload Size 100mb WP Active plugins
   ManageWP – Worker v.4.2.12 by ManageWP WP Missed Schedule v.2014.1231.2016.1 
   by sLaNGjI’s Team Adaptive Images for WordPress v.0.6.60 by Nevma Advanced Random
   Posts Widget v.2.1.0 by Theme Junkie Akismet v.3.2 by Automattic Amazon Link 
   v.3.2.6 by Paul Stuttard Autoptimize v.2.1.0 by Frank Goossens (futtta) Comet
   Cache v.161119 by WebSharks, Inc. Crop Thumbnails v.0.10.11 by Volkmar Kantor
   Facebook Thumb Fixer v.1.6 by Michael Ott Flickr Badges Widget v.1.2.9 by zourbuth
   GA Google Analytics v.20161116 by Jeff Starr Simple Calendar v.3.1.8 by Moonstone
   Media iframe v.4.3 by webvitaly Jetpack by WordPress.com v.4.4.1 by Automattic
   Responsive Flickr Slideshow v.2.4 by Robert Peake New Google Plus Badge Widget
   v.1.1.2 by MyThemeShop Social Login v.5.2 by Claude Schlesser Fast Secure Contact
   Form v.4.0.44 by Mike Challis, Ken Carlson Simple Flickr Set v.1.0 by Scott A.
   Williams Slickr Flickr v.2.5.4 by Russell Jamieson Stout Google Calendar v.1.2.3
   by Matt McKenny Cookie Consent v.2.2.0 by Catapult_Themes WP Ajax Search Widget
   v.1.1 by Scott Evans WP Mailto Links – Manage Email Links v.2.1.6 by Victor Villaverde
   Laan WP User Avatar v.2.0.7 by flippercode Comments – wpDiscuz v.4.0.2 by gVectors
   Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan) WP MU plugins ManageWP – Worker
   Loader v. by ManageWP

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

 *  Thread Starter [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8511026)
 * Incidentally, in case it makes a difference, I am also using Autoptimize and 
   Comet Cache. Both of these created their own cache folders in the same location
   as AIfW wishes to put its own, so the folder is definitely accessible.
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8513298)
 * Hello, my friend,
 * Thanks for reaching out to us and for going to all this trouble debugging the
   plugin.
 * There is one thing I find a little unusual and I think might be causing the problem.
   Your website is at `http://www.moshville.co.uk/`, however all your assets, the
   images, the theme, the plugins, etc are all inside `http://www.moshville.co.uk/
   wordpress/`.
 * Is there a particular reason for this? Have you made some kind of configuration
   in your `.htaccess` file in order to bypass the extra `/wordpress/` directory
   in your website url? I believe this is what is confusing our plugin and leads
   it to be unable to find either the cache folder or the original images themselves.
 * Let’s take this step by step!
 * Cheers,
    Takis
 *  Thread Starter [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8513318)
 * Hey Takis,
 * A fair question and it’s down to history and file organisation. I’ve got other
   stuff on the site as well, including a forum, which mean that the wordpress files
   can’t be placed in the root folder, hence the “wordpress” sub-folder.
 * I have just double-checked to be certain, but there are no changes to my .htaccess
   which would cause any problems. I’ve pasted it below for you to double-check.
   I don’t think there’s anything there of a “security” concern.
 * The wordpress folder has its own .htaccess file, but it’s empty. The file below
   is in the root of the site.
 * DirectoryIndex index.php
    Redirect /atom.xml [http://www.moshville.co.uk/feed/atom/](http://www.moshville.co.uk/feed/atom/)
   Redirect /rss.xml [http://www.moshville.co.uk/feed/rss/](http://www.moshville.co.uk/feed/rss/)#
   RedirectMatch 301 (.*)\.html$ [http://www.moshville.co.uk$1/](http://www.moshville.co.uk$1/)#
   Redirect /wordpress/wp-includes/js/tinymce/plugins/wpeditimage/editimage/ [http://www.moshville.co.uk/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html](http://www.moshville.co.uk/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html)
 * # Ensure PHP5 being used
    # For WordPress auto upgrade AddType x-mapp-php5 .php
   AddHandler x-mapp-php5 .php
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule
   ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] </IfModule>
 * # END WordPress
 * #Allow large uploads
    #php_value upload_max_filesize 256M #php_value post_max_size
   256M #memory_limit = 256M #php_value max_input_time 3000 #php_value max_execution_time
   3000
 * #R.I.P. Terry Pratchett
    <IfModule headers_module> header set X-Clacks-Overhead“
   GNU Terry Pratchett” </IfModule>
 * ## Dave added optimisation
    ##Begin – Expires caching <IfModule mod_expires.c
   >
 * ## This rule will create an ETag for files based only on the modification timestamp
   and their size.
    ## Note: It may cause problems on your server and you may need
   to remove it FileETag MTime Size
 * SetOutputFilter DEFLATE
    Header set Expires “max-age=29030400, public” Header
   unset ETag FileETag None
 * # Enable expiration control
    ExpiresActive On
 * # Default expiration: 1 hour after request
    ExpiresDefault “now plus 1 hour”
 * # CSS and JS expiration: 1 week after request
    ExpiresByType text/css “now plus
   1 week” ExpiresByType application/javascript “now plus 1 week” ExpiresByType 
   application/x-javascript “now plus 1 week”
 * # Image files expiration: 1 month after request
    ExpiresByType image/bmp “now
   plus 1 month” ExpiresByType image/gif “now plus 1 month” ExpiresByType image/
   jpg “now plus 1 month” ExpiresByType image/jpeg “now plus 1 month” ExpiresByType
   image/jp2 “now plus 1 month” ExpiresByType image/pipeg “now plus 1 month” ExpiresByType
   image/png “now plus 1 month” ExpiresByType image/svg+xml “now plus 1 month” ExpiresByType
   image/tiff “now plus 1 month” ExpiresByType image/vnd.microsoft.icon “now plus
   1 month” ExpiresByType image/x-icon “now plus 1 month” ExpiresByType image/ico“
   now plus 1 month” ExpiresByType image/icon “now plus 1 month” ExpiresByType text/
   ico “now plus 1 month” ExpiresByType application/ico “now plus 1 month” ExpiresByType
   image/vnd.wap.wbmp “now plus 1 month” ExpiresByType application/vnd.wap.wbxml“
   now plus 1 month”
 * # Other optimizations
    ExpiresByType application/x-gzip “access plus 1 month”
   ExpiresByType application/x-shockwave-flash “access plus 1 month”
 * </IfModule>
    ## End – Expires caching ## End Dave
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8518649)
 * Hello again, my friend,
 * It seems that the same [problem](https://wordpress.org/support/topic/htaccess-path-to-adaptive-images-script-php-is-always-wrong/)
   has presented itself again in the recent past. Actually it is not a problem per
   se, it is a bug in the plugin, because we had not taken the setup described [here](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory)
   into account. This is the setup you have followed as well, where the WordPress
   files are in a subdirectory of the root folder, but the website url is still 
   the root of the domain.
 * Thanks to [@milenoi2016](https://wordpress.org/support/users/milenoi2016/) she
   has worked out a small temporary fix to the problem which is described in her
   comment [here](https://wordpress.org/support/topic/htaccess-path-to-adaptive-images-script-php-is-always-wrong/#post-8170639).
   In your case it should be something like:
 *     ```
       in adaptive-images-actions.php
   
       // Remove the $request_uri_base here: 
       $adaptive_images_php_script = $request_uri_base. ‘/’ . $adaptive_images_dir_path_relative . ‘/adaptive-images-script.php’;
   
       // So it becomes: 
       $adaptive_images_php_script = ‘/’ . $adaptive_images_dir_path_relative . ‘/adaptive-images-script.php’;
   
       // Actually she simply removed the $request_uri_base.
       ```
   
 * This seems to correct the problem for now.
 * Sorry for not being able to provide a direct solution to the problem right away,
   but there will be a proper fix to the problem in a version to come.
 * Let me know if this works for you and if you need anything more!
 * Cheers,
    Takis
    -  This reply was modified 9 years, 5 months ago by [Takis Bouyouris](https://wordpress.org/support/users/nevma/).
 *  Thread Starter [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8522275)
 * Perfection!
 * The only thing to note for anyone else who finds this of use – I first of all
   copy/pasted the “corrected” code and received an error when I activated the plug-
   in. This was due to the “curly” single quotes:
 * `‘/’`
 * I changed these to “straight” quotes:
 * `'/'`
 * … and it worked a treat. THANK YOU!
 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8523397)
 * I am very happy to hear this!
 * All kudos go to [@milenoi2016](https://wordpress.org/support/users/milenoi2016/)
   of course, who originally made the fix and I promise to incorporate it in the
   next version, so that you do not need to worry about it any more.
 * Cheers,
    Takis

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

The topic ‘Not creating cache folder’ is closed to new replies.

 * ![](https://ps.w.org/adaptive-images/assets/icon-256x256.png?rev=1138642)
 * [Adaptive Images for WordPress](https://wordpress.org/plugins/adaptive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adaptive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adaptive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/adaptive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adaptive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adaptive-images/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 6 replies
 * 2 participants
 * Last reply from: [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/not-creating-cache-folder/#post-8523397)
 * Status: not resolved