• Resolved ajgray

    (@ajgray)


    Nevma —

    I’m having similar issues to other folks: no images are being generated within the cache folder, which causes all images on the site to break: http://staging.tartandruim.com.

    The cache/adaptive-images folder was not created when the plugin was activated, so I created it manually. To debug and ensure that there are no permission issues, I temporarily changed the permissions to 777.

    Here is the debug output (with the actual root folder removed):

    ✔ PHP GD library is installed.
    ✔ Image cache directory has been created.
    {folder}/wp-content/cache/adaptive-images => drwxrwxrwx
    ✔ Installation .htaccess file is setup OK.
    {folder}/.htaccess => -rw—-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(75)
    [“sharpen-images”]=>
    bool(true)
    [“watch-cache”]=>
    bool(true)
    [“browser-cache”]=>
    float(180)
    [“landscape”]=>
    bool(false)
    [“hidpi”]=>
    bool(false)
    [“cdn-support”]=>
    bool(false)
    [“version”]=>
    string(5) “0.6.1”
    [“sanitized”]=>
    bool(true)
    }

    And here’s the relevant portion of .htaccess (again with actual root folder removed):

    # BEGIN Adaptive Images
    #=======================

    <IfModule mod_rewrite.c>

    RewriteEngine On

    # Watched directories
    RewriteCond %{REQUEST_URI} /wp-content/uploads [OR]
    RewriteCond %{REQUEST_URI} /wp-content/themes

    # Redirect images through the adaptive images script
    RewriteRule \.(?:jpe?g|gif|png)$ {folder}/wp-content/plugins/adaptive-images/adaptive-images-script.php [L]

    </IfModule>

    # END Adaptive Images

    And here’s the diagnostic output:

    Web Server
    Apache
    PHP
    5.4.44
    PHP Time Limit
    50000
    PHP Memory Limit
    256M
    PHP Post Max Size
    8M
    PHP Upload Max Size
    40M
    PHP Max Input Vars
    5000
    PHP Display Errors
    1
    PHP Error Log
    MySQL
    5.1.73-log
    MySQL Ext/mysqli
    No
    MySQL Table Prefix
    td_
    MySQL DB Charset
    utf8
    WordPress
    4.3
    WP Multisite
    No
    WP Debug Mode
    No
    WP Site url
    http://staging.tartandruim.com
    WP WP Home url
    http://staging.tartandruim.com
    WP Permalinks
    /%postname%/
    WP content dir
    {folder}/wp-content
    WP content url
    http://staging.tartandruim.com/wp-content
    WP plugin dir
    {folder}/wp-content/plugins
    WP plugin url
    http://staging.tartandruim.com/wp-content/plugins
    WP Locale
    en_US
    WP Memory Limit
    40M
    WP Max Upload Size
    8mb
    WP Active plugins
    Adaptive Images for WordPress v.0.6.1 by Nevma
    Black Studio TinyMCE Widget v.2.2.6 by Black Studio
    Contact Form 7 v.4.2.2 by Takayuki Miyoshi
    Disable Comments v.1.3.2 by Samir Shah
    Easy Google Fonts v.1.3.9 by Titanium Themes
    Lightbox Plus Colorbox v.2.7.2 by Dan Zappone
    Page Builder by SiteOrigin v.2.1.5 by SiteOrigin
    SiteOrigin Widgets Bundle v.1.4.2 by SiteOrigin
    Spacer v.1.0 by Justin Saad
    Title Remover v.1.0 by Brittany Internet Services
    WP Clone v.2.1.8 by WPCrafter.com

    Any ideas on how to get the images to be generated?

    Thanks —

    –Andy

    https://ww.wp.xz.cn/plugins/adaptive-images/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Takis Bouyouris

    (@nevma)

    Hello, Andy,

    First of all, thank you for being so thorough and provide all the basic debug info!

    Your basic settings and setup seem OK. I will have to put you through the process of the basic questions, though. Right now the plugin does not seem to be activated in your staging environment (kudos for using one). I will need the plugin to be activated in order to do some debugging. Could you do that for me, at least for some hours?

    Now, a usual problem is that people try to test the plugin from a normal browser. Nothing will happen there really. In order for the plugin to actually intervene and work one has to use either a real mobile device or some kind of emulator, like Chrome Developer Tools in device mode, or WebPageTest.org with mobile emulation on.

    Last, but not least, the images will be generated only after being requested and not in advance, to save your server the extra load.

    Let’s take it from here and we will get to the bottom of this!

    🙂

    Cheers,
    Takis

    Thread Starter ajgray

    (@ajgray)

    Sure thing – since the plugin broke all images, I disabled it for now, but I’ve re-enabled it for a bit. (Folks on the extended team are reviewing the site, so I need to restore the images as soon as possible.)

    Yes, I’ve attempted to access the site from Chrome Developer Tools and from real mobile devices, with real image requests and page refreshes.

    Thanks!

    Thread Starter ajgray

    (@ajgray)

    I need to restore the images to the site, so I’m going to disable the plugin again. When you have time to investigate, please ping me and I can temporarily enable it again. Thanks.

    Plugin Author Takis Bouyouris

    (@nevma)

    Hey, Andy,

    Is now a good time perhaps?

    Thread Starter ajgray

    (@ajgray)

    Sure, I’ve re-enabled the plugin – thanks!

    Plugin Author Takis Bouyouris

    (@nevma)

    Checking right now, thank you! 🙂

    Plugin Author Takis Bouyouris

    (@nevma)

    OK, now my first observation is that, for instance, this image url http://staging.tartandruim.com/wp-content/uploads/2015/07/tartan_druim_logo.png?debug=true has (!) to provide some debugging output (notice the (?debug=true”). But it isn’t!

    If the htaccess file is actually setup correctly, then this is impossible. I see only two options for such a problem:

    1) The line in your htaccess file RewriteRule \.(?:jpe?g|gif|png)$ {folder}/wp-content/plugins/adaptive-images/adaptive-images-script.php [L] does not have a correct path pointing to the script file, and we must find out why this happened.

    2) The file system in your staging environment is doing some sort of “acrobatics” and prevents the script specified in htaccess from being found.

    Do the above ring any bells to you?

    Thread Starter ajgray

    (@ajgray)

    Hmm, no. I double checked the path in the .htaccess file, and while lengthy, it seems to be correct. I can email the .htaccess file to you if you send me your email address (I’d prefer not to post the path publicly).

    I can’t imagine what “acrobatics” would be done in the file system – it’s just a path to the file.

    Plugin Author Takis Bouyouris

    (@nevma)

    You can contact me at info [@] nevma.gr for an email.

    Well, with “acrobatics” I was thinking some kind of “chrooted” staging environment. Not so sure about that… just trying to figure it out.

    As it appears, it is pretty clear that Apache cannot find the proper PHP script file through htaccess, so it returns a 404 error.

    Thread Starter ajgray

    (@ajgray)

    Interesting: in .htaccess I changed the path to the script from an absolute path to a relative one, so that instead of:

    RewriteRule \.(?:jpe?g|gif|png)$ /{folders}/wp-content/plugins/adaptive-images/adaptive-images-script.php [L]

    it’s now instead simply:

    RewriteRule \.(?:jpe?g|gif|png)$ wp-content/plugins/adaptive-images/adaptive-images-script.php [L]

    and it now seems to be working: http://staging.tartandruim.com/wp-content/uploads/2015/07/tartan_druim_logo.png?debug=true

    I have no idea why the absolute path wasn’t working – perhaps some sort of permission issue, or path length issue? In any event, I’ll keep an eye on this; thanks for investigating and for the clue!

    Plugin Author Takis Bouyouris

    (@nevma)

    Yeap, it is working now alright!

    However, the intended behaviour is to have the relative path set in the htaccess file. This means that you got the absolute path by accident and I would really like to find out why, but that would require debugging right inside the server.

    Should we leave it there then or would you like some more help?

    Thread Starter ajgray

    (@ajgray)

    Hmm, I just installed the plugin through the WordPress admin panel. I didn’t edit .htaccess directly, it was just modified automatically when the plugin was activated.

    I believe that I’m unblocked for the moment on this project, but I’d be glad to help you diagnose the absolute/relative path issue if needed. I emailed you the .htaccess file as it existed after I activated the plugin.

    Thread Starter ajgray

    (@ajgray)

    The preg_replace() call on line 146 of adaptive-images-actions.php must not be matching as expected – presumably due to the computation of $document_root above.

    I have some more information for you – check for followup email.

    Plugin Author Takis Bouyouris

    (@nevma)

    You are the best, thank you very much!

    Indeed the issue must be right there, where I get the document root. I’ll check my emails and reply to you from there!

    Cheers,
    Takis

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

The topic ‘Images not generated in cache folder’ is closed to new replies.