Answer the question
In order to leave comments, you need to log in
How to make the Imagick module built into the local Open Server work?
Installed openserver. I switched to it from Denwer, because I could not install Imagick there, but here it is built-in. But for some reason he does not want to work, as if he does not need any module. I upload the script to the hosting, it works there, but still developing on the hosting is inconvenient.
Maybe Imagick needs to be enabled somehow? I haven't found anything about it on the internet though.
Php_info tells you that Imagick is connected.
After adding the path to the folder in which Imagick is installed in the Path in the computer properties, the convert function works via cmd. But I need through php
When I try to insert such code:
<?php
$image = new Imagick('im.jpg');
// Если в качестве ширины или высоты передан 0,
// то сохраняется соотношение сторон
$image->thumbnailImage(100, 0);
?>
$image = new Imagick('http://project/im.jpg');
Answer the question
In order to leave comments, you need to log in
You need to provide the path, not the url.
http://project/im.jpg- this is url.
In what case is the message that Imagick is not connected shown?
I faced such problem earlier when I worked with the terminal in PhpStorm'e. I also use OpenServer.
I solved that question as follows:
1. Right key on the icon OpenServer'a.
2. Settings - "Bookmarks" tab.
2.1. Name - any name (I used PhpStorm).
2.2. Category - any (I used a new one - IDE).
2.3. Run - path to PhpStorm's exe.
3. Add.
4. Save.
5. Reboot the server.
6. Launch PhpStorm via bookmarks, not from the desktop or start icon.
6.1. Right key on the OpenServer icon.
6.2. My bookmarks - category (which was indicated) - title (which was indicated).
After all this, I could use the terminal in PhpStorm without this error already.
Under Windows imagick only sees absolute paths, __DIR__ is needed.$image = new Imagick(__DIR__.'/file_name');
If you work in CMS, use a constant for example DIR_IMAGE -OpenCart
If self-written or do not know constants, use $_SERVER['DOCUMENT_ROOT'] and then specify the path to the image.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question