The -f
option does not exist in lighttpd so I switch to apache2 and everything work well.
How Avalanche Imagine Bundle can work on production environment?
-
13-04-2022 - |
题
I try to use AvalancheImagineBundle and I don't understand how it can works in production environment.
The default cache_prefix is media/cache. All cached images will be in the myProject/web/media/cache directory and it's also a Symfony2 route :
Name Method Scheme Host Path
_imagine_thumbnail GET ANY ANY /uploads/cache/{filter}/{path}
If I do a test on this url "http://my-project.fr/app.php/", the bundle works fine:
- The first time, I try to show the /app.php/media/cache/thumbnail/profile.jpg picture. The Symfony2 route is caught. The bundle return the cropped picture and cache it.
- The second time, the route is caught again and the bundle redirects me to the cached picture /media/cache/
In short, the first time /app.php/media/cache -> bundle, and second time /media/cache -> assets
But in production environment, app.php is missing so how the bundle can do the difference ?
解决方案 2
其他提示
I'm not familiar with lighttpd, so I can only point you to a direction where to look.
The "switch" is done via .htaccess
, here are two relevant lines and explanation:
# If request is an existing file, then it's simply returned
RewriteCond %{REQUEST_FILENAME} !-f
# Else the request is pushed to the app.php front controller
RewriteRule ^(.*)$ app.php/$1 [QSA,L]
I think you're missing first part of this config.
P.S. Note that app.php
isn't actually missing, it's just "hidden".