Imagine library not working in shared hosting - symfony

So I was developing a site that needed image resize so I decided to use avalanche123/imagine-bundle which uses the imagine library
In my local everything worked perfectly and then I uploaded the project to a shared hosting
When I go to the url generated by imagine bundle prints a zero
So I tried to find out where the problem is and I found it executes until this line
$image = $this->imagine->open($sourcePath);
$this->imagine is an object with class Imagine\Image\ImagineInterface
So when this line is executed it just returns 0
No exception is thrown and nothing is shown in logs
And I don't really know how imagine works inside and it seems no one else had this problem
So does anyone know what's the cause?

The AvalancheImagineBundle uses the Imagine PHP library to compute images. As stated in the README:
Depending on the chosen Image implementation, you may need one of the
following:
GD2
Imagick
Gmagick
It seems that you can choose the driver with the following configuration:
avalanche_imagine:
driver: gd
The value can be gd, imagick or gmagick and gd seems to be the default. Go ahead and see if any of this three is installed on the shared host by outputting phpinfo();. Just search for the particular string and see if it is avaiable.

Related

Error when calling createDefaultLayers() in HERE API

EDIT: Is there anywhere to get an un-minified version of the Here-api to use when debugging? It's impossible for me to figure out what 'v' is and why it may be undefined.
We're using the HERE API both from our website where it works flawlessly and our old RDP C++ application which runs a similar webpage in an embedded IE window. It should be using a stripped version of IE11 I believe.
We recently upgraded to the new HERE API after routing stopped working in the old one, and it worked for a while but a while ago it suddenly didn't. And no one can recall making any changes that could affect this.
I have narrowed it down to a single line of code where it crashes. (platform is already defined in the scope through our geo-service script, the same one being used for the web that works)
var defaultLayers = platform.createDefaultLayers();
This is an initialization of the map layers that is required for the maps to work, but we simply can't perform this action through this embedded browser window even though we run almost identical code on the web.
We receive two error messages of:
'v' is undefined
With a reference to some dynamically generated eval code.
This is the only lead I've managed to dig up, it's not much but I'm hoping someone else has encountered a similar issue and can point me in the right direction what to look for.
I found the issue, it was totally self inflicted...
When we implemented the solution there was an issue in the core js file from Here which made it not work in our servers due to some path being wrong. To fix this we had changed the path so it worked and then hosted our own version of the core file.
This worked great, until Here put up a new minor release which is automatically distributed through the same content link as before. This meant the minified files were no longer in sync with the variable names, thus causing v to never be defined where it should, since in our file it was probably named something else.
It was only by chance I noticed that the core js was side-loaded like that, I was looking in the completely opposite direction the entire time and didn't even consider the loading might've been tinkered with.

QuickLook - Application UTI overriding QLGenerator UTI

I wrote a .qlgenerator for a particular set of file types and defined a supposedly correct set of "Imported Type UTIs" in the .plist file.
The form of UTIs is "public.archive.xxx.yyy", where "xxx" is a vendor code and "yyy" is a particular file type.
I write "supposedly", because everything seems to work fine until I install the .qlgenerator on another computer running 10.5. There it just doesn't work. Using qlmanage command I found out that the generator plugin gets properly registered for the given UTIs but when I invoke it to show preview of a file it says that my files are of type "public.archive.yyy" "rather than "public.archive.xxx.yyy". I eventually found the reason for that: On that second computer, there is an application installed, which defines those UTIs and registers itself as "Editor". The application does not provide QuickLook plugin but renders mine unusable anyway.
How can I make sure that my plugin will be used, even if someone has this (or similar) application installed?
Thanks in advance.

Upload Image file using Symfony2 without guessers?

I am using Symfony2 framework for one of my project. In this one, I want to upload an image. This is really easy to do so while following the Symfony2's cookbook. It works very well on my local machine. But when I put the whole application on my remote server (Planethoster.net shared hosting), it doesn't work because of the Type-Mime extension guessers. In fact, they are not enable on their servers... (phpinfo shows --disable-fileinfo)
So, basically the idea is to know if there is a solution to do the same action (uploading an image) without any extension guessers?
Thanks
What do you think of filtering the filename ? With the last three characters, you'll know the extension. Check out UploadedFile, there is a getClientOriginalName() method. What I would do is to explode it by the ., fetch the second entry of the resulting array, and then parse it to do what you want to do.
Would you like an example of code ?
To fix exception while uploading file using framework Symfony 2
Unable to guess the mime type as no guessers are available.
enable PHP extension php_fileinfo, to do this find your php.ini file and uncomment following line
; windows
extension=php_fileinfo.dll
or
; linux
extension=php_fileinfo.so

Cannot customize sfGuardGroup - cached version autosfGuardGroup is always used

I'm using the sfGuardPlugin with Propel on Symfony 1.4.11. I'm overriding some templates in sfGuardUser as well as sfGuardGroup and sfGuardPermission. On my localhost version this works, but on shared hosting the sfGuardGroup and sfGuardPermission modules stubbornly ignore the templates in my app, reverting instead to the cached autoXXX modules. Curiously the sfGuardUser works in this respect on both platforms.
The debug log is identical until the step
Call "sfGuardGroupActions->executeIndex()"
The local version continues correctly with
Render "sf_app_dir/modules/sfGuardGroup/templates/indexSuccess.php"
While the remote server goes on like this:
Render "sf_root_dir/cache/backend/dev/modules/autoSfGuardGroup/templates/indexSuccess.php"
I have never seen any difference in the behavior of my modules before and this really stumps me. The files in both locations are identical, except the ProjectConfiguration.class.php and database.yml. I haven't found any mention of this kind of problem. Do you have any idea what could be causing this?
Edit:
Of course I cleared the cache on both ends.
Well this is embarrassing!
Notice how autoSfGuardGroup is spelled? When I copied the cached folder I took out the 'auto', leaving a capital 'S' in front of the name. My Mac happily ignored the caps but the hosted server was not so nice.
All is well now.
Maybe I should get new glasses ... 8-}

Selenium-Flex API sample problem

I'm trying the sample demo of selenium flex API. After following the instructions on the main page for compiling the project with sfpi.swc and taking the generated selben.swf in bin directory and trying to run some test(assertFlexText) using Selenium IDE, I get the following error:
[error] Function getFlexText not found on the External Interface for
the flash object selben
I have tried several other flex tests and got error messages similar to the one mentioned above.
For some reason I believe that the generated selben.swf through the automatic build of project in flex builder is not the desired one, though it didn't indicate any build problem after including sfpi.swc.
Any idea?
I use SeleniumFlex Api and SeleniumIde for my projecy with excellent result BUT using my own version of each of one. Your error maybe is for not include the lib of SeleniumFlexApi in the compile time( -include-libraries "libs\SeleniumFlexAPI.swc" ).
After that u can enable capture and replay with SeleniumIde change the main source (read this post) and use the user-extensions.js (in the SeleniumFlexApi project) with the SeleniumIde user option. Its really easy.
With these change u can capture and replay in firefox (v 3.06 or minor) and after that, if u use java, u can use Flex-UI-Selenium, Flash-Selenium for ur integration test with SeleniumRC.
I hope this information be usefull. I u have any question let me know.

Resources