What is the difference between Imagemagick and Imagick ?
How do I configure Imagick to work with IIS and php 5.4.14?
Side-note, ImageMagick is not a "PHP Utility" it's a command line utility that existed before PHP. It can be used by many programs, or by people directly, to manipulate images.
Wherea Imagick is a native implementation of the ImageMagick API for PHP -- https://www.php.net/manual/en/intro.imagick.php
I know my answers are trivially different, but when it comes to a lot of things (including programming), the devil is in the details.
I unfortunately have no reference for installing PHP with Imagick/ImageMagick on Windows/IIS But I assume the DLL answer to be the correct one.
Imagick is a php API for Imagemagick.
Find the correct dll, uncomment imagick in php.ini and prepare to spend some time getting it working.
ImageMagick is a PHP utility, a command line tool for image manipulation.
For further details, see this.
Imagick is an API or a class that performs the function same as ImageMagick. It provides numerous functions for image manipulation in PHP. Refer to this for more details.
For imagick, you need ImageMagick as well. Run the following command for the same.
sudo apt-get install imagemagick php5-imagick
The installation is well explained with requirements in PHP manual.
ImageMagick vs Imagick
ImageMagick® is a free and open-source software suite for displaying, converting, and editing raster image and vector image files. It can read and write over 200 image file formats, and can support a wide range of image manipulation operations, such as resizing, cropping, and color correction. -- excerpt from the publisher's site.
ImageMagick may or may not be installed on your system, and was independent of PHP and IIS. While it is a popular image editing program, windows users may be uncomfortable with the absence of a gui; it is mostly run from the command line.
Imagick is the name given by PHP to its extension to ImageMagick. Imagick extends PHP by wrapping or using much of the source code of ImageMagick, but not necessarily the files installed with ImageMagick.
Install Imagick Extension
To enable PHP's Imagick extension for use by a FastCGI module and the PHP CLI, the Imagick PECL package had to be installed. Caveat: instructions herein apply to webservers that use a FastCGI module to call PHP, not a sapi (server) module.
You can start with PHP's windows site, which links to PECL extensions
Use search, or browse >> 'Images', for Imagick, for the link to the Imagick PECL package.
On the PECL package page, links to the windows packages were labelled 'DLL.' Follow the link to the latest package. If you're on the DLL version page, select for your PHP, architecture (x86 32-bit or x64), and thread safety (TS or NTS). FastCGI PHP always needed NTS (non-thread safe). Confirm your requirements with phpinfo.
Download the PECL package and extract it to a folder of your choice, like imagick_php. On windows, it could be 'c:\imagick_php'. Also on windows, imagick_php size could be reduced by 2/3 by moving out or deleting all *.pdb files.
Make imagick_php available to Imagick, by adding the path to imagick_php to a PATH environment variable.
Options:
Set system environment PATH variable; makes imagick_php available to software on your system that refers to the PATH variable, including PHP CLI and FastCGI, but requires a reboot.
If you use IIS much more than PHP's CLI, you can share Imagick only with PHP as FastCGI, and without a reboot.
In Administrative Tools > IIS Manager > Server > FastCGI Settings, find the 'application' that corresponds to the site's > Handler Mappings > PHP-FastCGI > Executable.
Editing that 'application,' add a variable to the Environment Variables collection: Name path, Value c:\imagick_php;%path%.
Copy the php_imagick.dll from imagick_php to PHP's extension_dir. On windows, it could be 'c:\php\ext'
Instruct PHP to load the Imagick extension on start up. In php.ini, add the line extension = imagick, PHP 7.2+ figures out the path and .dll file name.
Confirm PHP loads Imagick without error. Either browse to a phpinfo file and look for an imagick section, or if your PHP's CLI is setup, set path=c:\imagick_ph;%path% followed by php -d extension=imagick -m, and look for imagick in the list of loaded modules.
Confirm Imagick extension functionality:
Copy examples/captcha.php from imagick_php folder to the webserver site. If on Windows, edit captcha.php, update setFont('Tahoma') or another font on your system.
Finally, browse to the url of captcha.php. Expect a captcha image to be displayed.
For the first question, I think you are asking the difference between ImageMagick (not Image magick) and imagick. PHP Manual gives an explanation http://php.net/manual/en/intro.imagick.php.
For the second question, it is too broad to answer. Maybe you could ask one specific aspect or problem you met.
Related
I am running a MediaWiki (1.34.1) on a Windows server. The wiki contains some Lua modules which are executed by the Scribunto extension running Lua 5.1.4.
Up to now I am using the luastandalone but I would like to use the luasandbox engine (should be faster).
With the lastest PHP luasandbox release 4.0.2 PECL provides a Windows DLL (https://pecl.php.net/package/LuaSandbox/4.0.2/windows).
With this DLL is it possible to run luasandbox under Windows?
How can I install/configure the PHP/MediaWiki/Scribunto environment to use this DLL?
Yes, it is possible to use LuaSandbox under Windows with IIS, and is in fact an especially convenient way to do so, You simply install the necessary Lua binary as a PHP extension into your existing PHP interpreter (which you know is working, because MediaWiki is implemented in PHP).
I discuss this at some length in this conversation on the MediaWiki page Extension Talk:Scribunto but I'll provide the essentials here as well:
I did finally get Lua working under IIS on Windows 10, with PHP 8.0. The trick was, I abandoned the luaStandalone binary entirely, and instead downloaded the (just released less than 2 months ago) PHP luaSandbox extension from PECL:
https://pecl.php.net/package/LuaSandbox
Click on "DLL", then choose the build that matches your PHP install (for me it was PHP 8.0, x64, non-thread safe — the details are at the very top of the long, long output of php.exe -i from a command line), and download the provided zip file. After extraction, only two files are important:
php_luasandbox.dll, a PHP extension module that goes wherever the rest of your extensions are. (For me, C:\Program Files\PHP\v8.0\ext\.)
lua5.1.dll, an embeddable Lua interpreter that gets installed in the directory where the php.exe binary lives. (For me that was C:\Program Files\PHP\v8.0\, the parent directory of the extension location).
After that, just edit your php.ini to add:
extension=php_luasandbox.dll
and edit LocalSettings.php to include:
$wgScribuntoDefaultEngine = 'luasandbox';
(making sure to remove or comment out any lines about luaStandalone).
Relaunch IIS, and that should be that. If you have MediaWiki working at all, you've already got PHP running, so using Lua that way, as a PHP extension, just makes eminent amounts of sense.
As I note in the MediaWiki discussion, there's some degree of controversy over this because the Lua developers themselves are sort of down on the notion of a "sandboxed Lua". They do not believe it to be a technically viable method of restricting Lua's access to and consumption of system resources. But on Windows, most of the restrictions they recommend imposing on the standalone binary are not available from the OS anyway, making the situation even more confusing/unclear.
I have enabled the mbstring extension by removing the ';':
extension=php_mbstring.dll
I am using the correct php.ini file, checked by using phpinfo().
Extension dir specified in php.ini: extension_dir = "c:/wamp/bin/php/php5.5.12/ext/"
Indeed, when I go there, I find 'php_mbstring.dll'
I've restarted wamp multiple times.
What else can be wrong here?
UPDATE:
seems, my whole wamp installation is fd up with respect to mysql:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I do have mysql installed and everything though...module is also enabled etc.
This sounds like you have a rouge php.ini file somewhere and it is loading the wrong one.
There are actually 2 php.ini files in WAMPServer as in most PHP/Apache installations.
One is called \wamp\bin\php\{phpversion}\php.ini and this is only used by the PHP CLI
The other is called \wamp\bin\php\{phpversion}\phpForApache.ini and is used when you are running PHP through Apache.
If you use the wampmanager menus you will edit the one used by Apache/PHP i.e.
wampmanager => PHP -> php.ini
However if you have actually edited the correct php.ini then it is likely you have a rouge version of php.ini somewhere on your system.
Run the phpinfo() link again from the wampmanager homepage and check this parameter which is shown on the first section of the output.
Loaded Configuration File
It should be pointing to \wamp\bin\php\php5.5.12\phpForApache.ini in your case.
If its pointing somewhere else then you probably tried to install PHP and Apache manually before finding WAMPServer and that has left a php.ini file somewhere where Apache is finding it.
Here is the PHP Manual page that defines the search path order used by Apache when looking for a php.ini file. This may help you find and remove any rouge versions of php.ini
Install the gd library also.
check this link http://www.php.net/manual/en/mbstring.installation.php
or
There's a much easier way than recompiling PHP. Just yum install the required mbstring library:
Example: How to install PHP mbstring on CentOS 6.2
yum --enablerepo=remi install php-mbstring
Oh, and don't forget to restart apache afterward.
Im using gnat4.6 on Ubuntu installed using apt-get. I need to know where to install downloaded libraries like APQ. What should I set my ADA_INCLUDE_PATH and ADA_OBJECTS_PATH to?
The beauty of Ada support in Debian (on which Ubuntu is based) is that you don't need to mess with ADA_INCLUDE_PATH and friends; supported libraries are installed where the GNAT Project Manager expects to find them. Say gnatls -v to see the default values.
To use the system as intended, you will find it much simpler to use the GNAT Project Manager; you'd say, in your my_project.gpr file,
with "apq";
project My_Project is
...
and build with
$ gnatmake -P my_project
There's online documentation for GPR, but I wouldn't call it particularly user-friendly. There's a set of Youtube videos (I haven't looked at them in any detail; their stated interest is large systems, but hang in there).
I use gnatmake to build; how do I cite my build paths in a correct way?
The relevant options are shown in 6.2 Switches for gnatmake: Source and library search path switches.
Addendum: The development package is libapq3.2.0-dev.
The manual is in /usr/share/doc/libapq3.2.0-dev/manual.pdf.gz
An example and corresponding .gpr file are in /usr/share/doc/libapq3.2.0-dev/examples. As #Simon suggested, the .gpr file begins:
with "apq.gpr";
project APQ.Samples is
The Ada include files are in /usr/share/ada/adainclude/apq.
The libraries are in /usr/lib.
$ dpkg -L libapq3.2.0-dev
/.
/usr
/usr/share
/usr/share/ada
/usr/share/ada/adainclude
/usr/share/ada/adainclude/apq
/usr/share/ada/adainclude/apq/apq_helper.ads
/usr/share/ada/adainclude/apq/apq_helper.adb
/usr/share/ada/adainclude/apq/apq.adb
/usr/share/ada/adainclude/apq/apq.ads
/usr/share/ada/adainclude/apq.gpr
/usr/share/doc
/usr/share/doc/libapq3.2.0-dev
/usr/share/doc/libapq3.2.0-dev/copyright
/usr/share/doc/libapq3.2.0-dev/manual.pdf.gz
/usr/share/doc/libapq3.2.0-dev/examples
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.adb
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.ads
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.gpr
/usr/lib
/usr/lib/libapq.a
/usr/lib/ada
/usr/lib/ada/adalib
/usr/lib/ada/adalib/apq
/usr/lib/ada/adalib/apq/apq_helper.ali
/usr/lib/ada/adalib/apq/apq.ali
/usr/share/doc/libapq3.2.0-dev/changelog.Debian.gz
/usr/lib/libapq.so
Hy there,
I have a shared hosting account. They installed Image Magick on my request. But I get this error.
PHP Fatal error: Class 'Imagick' not found in /home/hamrohos/public_html/test.php on line 6
I told them what was wrong. They replied
ImageMagick is installed, but php extension of Imagick is not enabled on shared accounts
Now my question is Can I use Image magick or its any features if its php extensions are not enabled?
Currently I am using GD library but it doesnot have all features of image magick.
I have following features disabled too.
phpinfo(), exec(), system(), passthru()
Without enabling ImageMagick extension in PHP, you won't be able to use the functions it providesdirectly.
The only way to use ImageMagick in this scenario would be to call it with a system function and execute everything as a shell script. You would have to save the image data on disk to do this and after processing them with imagemagick, you would have to load them again.
Thus, It would definitely be feasible, but with severe overhead and changes to your scripts.
my employers have a requirement to upload very large hi-res images. Ordinarily uploading such images does not work.
I was told using ImageMagick would help shift the image processing burden to the Linux server instead of php (so I don't have to set the php max_memory to some ridiculous level).
Anyway, I followed this tutorial: http://thewichitacomputerguy.com/blog/how-enable-install-imagemagick-drupal
I got the following response:
* warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s): (/var/www/vhosts/mysite.co.uk/httpdocs:/tmp) in /var/www/vhosts/mysite.co.uk/httpdocs/includes/image.imagemagick.inc on line 55.
* No file /usr/bin/convert could be found. PHP's open_basedir security restriction is set to /var/www/vhosts/mysite.co.uk/httpdocs:/tmp, which may be interfering with the attempts to locate ImageMagick.
I have determined the /usr/bin/convert file definitely exists on the server but I am at a loss regarding how to proceed.
Can you guys help a drupaler out?
If you're on shared hosting, you will need to speak with your provider. If you administer your server, you will need to edit your php.ini to allow open_basedir access to your imagemagick directory.
ImageMagik always give me a hard time...
That tutorial you cited isn't the way that I typically go about installing it. I think that installing ImageMagik to your /includes folder could be related to the problem. If you want to continue to try to make that work, then try configuring ImageMagik in the Drupal admin pages to look in the right place:
admin/settings/imageapi/config
(assuming you've got the ImageAPI module)
If you can't make the magik happen in there.. I'd try installing ImageMagik with SSH (assuming you've got shell access, because this is a dedicated server)
To do that get yourself Putty
Then figure out what distro of linux you are running (check your host's forum, or ask them.. or try this) and run a command like this:
apt-get install imagemagick
or like this..
yum install imagemagik
Once you get it you'll just need to test it and set up the Drupal image handling with ImageCache
A few cool related modules (once you get it working):
ImageField focus
Avatar crop