No images on production server
Closed this issue · 11 comments
On local server everything is allright, but if I move project to the production server no image is appear.
No error message is written, no records are in the log.
Do you have any idea how to fix this behavior?
Thank you
Pls do more investigation. Without info, i'm not able to investigate. Try to open image url in separate window/tab.
If I try open the image in a separate tab, I get the message: "The requested URL not found on this server."
In the Chrome console is message "Failed to load resource: the server responded with a status of 404 (Not Found)".
It seems like the macro don't create images.
Does your script has access rights to the file? Check the url, is it same as on you dev? Please do more investigation. I'm using it on prod for small icons and it is working.
The url is same as on devel. Folders rights are set on 755 and files rights are set on 644.
Are any settings needed in the .htaccess file?
I found that method run() of Presenter is not called.
ha, your htaccess could be wrongly configured. Just check i you have something like this there:
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
if yes, remove image extensions you are using. because this rule is trying getting it directly from server.
I try to find it.
I have one more question: is allright, that image links have this format:
http://www.web.com/images/hills/0x150-fill/image-1.jpg?storage=images
Why is there the storage parameter? I read the documentation and there is nothing about it.
According to the documentation, links should have this format:
http://www.web.com/images/hills/0x150-fill/image-1.jpg
the storage parameter is necessary. It's position is dependant on how you define your route
https://github.com/iPublikuj/images/blob/master/docs/en/index.md#providers
But in your example output, you don't have the storage parameter in link:
<a href="/images/products/original/filename.jpg">
<img src="/images/products/200x200-fill/filename.jpg" />
</a>
you are right, but this is only example :D
I solved the issue by changing
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz|map)$ index.php [L]
to
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|css|rar|zip|tar\.gz|map)$ index.php [L]
In the .htaccess file
this is correct, as i mention above, you have to remove image ext from the rule