• I am running WP 4.6 on 2 unbuntu servers, the only difference between the 2 is one has PHP7 and the other PHP5.5.30

    I have also setup a basic grid to show items from a certain CPT, using the overlay template it will show the image from the custom image URL with the name of the post. (nothing changed, just the basic out of the box template with this plugin)

    WP is installed within htdocs, and within that i created a folder (called publications) to store some images

    My problem is with the server that has PHP7:
    – If i give the custom image URL field the http or https URL of an image in that folder (say https://my-internal-ip/publications/image.jpg), it will not output the image in the grid.

    – If i choose an image from my library (aka wp-content/uploads) it will output the image
    – If i enter the URL of an image on another internal server it will output the image.
    – If i enter a public image URL, such has https://public-hostanme/images/image.jpg, it will output the image.

    On the server with PHP5.5.30 what does not work above works on this server.

    If i downgrade the php7 server to php5.5.30 it will work.

    What in php7 would cause something of this nature? Your help is appreciated.
    Thanks.

    • This topic was modified 8 years, 2 months ago by jelfs01mi.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Brecht

    (@brechtvds)

    When a custom image is not in the media library, the PHP getimagesize() function is used for getting its size. We actually use @getimagesize() so it fails silently. If it fails we use the featured image instead.

    In the /addons/custom-templates/templates/post/image.php you could remove that @ on line 163 and see if you get an error then.

    Brecht

    Thread Starter jelfs01mi

    (@jelfs01mi)

    Unfortunately, that didn’t work. The image still fails to display.

    Plugin Author Brecht

    (@brechtvds)

    Just removing the @ would not fix anything but allow for some easier debugging because it wouldn’t suppress errors anymore. Try doing some var_dumps in that area to see what’s going wrong.

    I have not been able to replicate the issue so I can’t really tell you what’s wrong.

    Thread Starter jelfs01mi

    (@jelfs01mi)

    There was some loop issue going out and back into the server via the http protocol. I’ve managed to solve this by entering the URL without the http header and address.

    So instead of https://internal-ip-or-hostname/publications/my-image.jpg i simply put publications/my-image.jpg.

    Thanks for your quick response, it put me on track to a solution. ??

    And great plugin!

    Plugin Author Brecht

    (@brechtvds)

    Good to hear you were able to fix the issue!
    Just let me know if you need anything else.

    Brecht

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP7 + Custom image URL’ is closed to new replies.