Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


ai-cache stays empty #32

html5anchor opened this Issue · 1 comment

2 participants


No mattter if I resize my browser or use a mobile user agent, the ai-cache folder remains empty.

I don't know how to actually debug adaptibe-images.php.

How should I know if the script works at all?


OK, the firs thing to check is that your .htaccess is working correctly. Make sure you've got a test.jpg file in the same folder that your .htaccess file is. Open up the .htaccess file and replace

RewriteRule .(?:jpe?g|gif|png)$ adaptive-images.php


RewriteRule .(?:jpe?g|gif|png)$ test.jpg

If your htaccess is working then every single image on your site will become the test.jpg image. If not, then there's something wrong with your htaccess file or Apache configuration.

Assuming that it works, change it back and then go into the PHP. At the top of the PHP file (but inside the PHP tags) write the line:

sendErrorImage("there is a problem");

Reload your page - all images should now be replaced with a black image that contains the error message "there is a problem". If that doesn't happen, then either you've not got the files in the right place and so the htaccess file is pointing at a non-existent file, or PHP isn't working properly.

If that did work and you got a black error image, then it's a case of using that to debug your server and find out where in the code things are breaking.

@MattWilcox MattWilcox closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.