HOME       >>       Programming

How To Find And Test Imagemagick Using Php


docduke

One of the powerful graphics manipulation programs that Xisto provides is home page in the right column:

 

Our Free Web Hosting offer :-

 

ImageMagick Support

I have not seen ImageMagick mentioned in any other free, or nearly free, Web service. This is one of the things that attracted me to Xisto. ImageMagick is very powerful. As its website describes its capabilities:

Personally, I am interested in it because it is a necessary tool in MediaWiki. If one wishes to typeset mathematical equations in MediaWiki (as is done in Wikipedia), ImageMagick is a required component of the extension that provides this capability.

 

A while ago, I had trouble finding it on gamma.xisto.com. This tutorial shows how to test for it, and verify that it is functional. Since the primary focus of Xisto is web hosting, the tutorial is in PHP. This illustrates how ImageMagick can be used in any website that uses PHP scripts.

 

Here is a PHP program to test for the presence of ImageMagick, and print out its version number.

Create a file in your public_html folder or a subfolder, paste this text into it, and name it something like test4im.php where the ".php" ending is necessary to get the PHP interpreter to process it. Point a browser at this file (e.g. http://forums.xisto.com/no_longer_exists/ website]/test4im.php). If you have access to "convert," you will get a return code of 0 plus two or three lines of text, reporting the version and location of ImageMagick. Strictly speaking, you do not need to create the alist function since it is only called once here, but if you wish to test other things, it will save repetitive typing. (This is, after all, a tutorial on PHP.)

 

There is one more important step to make sure you can use ImageMagick. Almost everything you do with it will involve creating a file. Therefore, you need to be sure you can give it an argument that correctly identifies the location you want, and provides the appropriate permissions. Suppose you want the output in a folder called "temp" in your public_html folder. First you must create the folder and set its permissions. Use cPanel to create a folder "public_html/temp". Use the "permissions" tool to set "temp" to "777" which means anyone (including the "user" that runs an html task) can write to the "temp" folder. Now add the following two lines to your "test4im.php" program, at the location of the next-to-last line above.

The first line creates an ImageMagick logo image and stores it in the "temp" folder. The second prints the return code. Save this modified file and reload the browser page. If you got a version number before, and now get a non-zero return code, you probably didn't create the "temp" folder in the right place, or set its permissions correctly. If you get a return code of 0, examine the "imlogo.gif" file using the "View" tool in the cPanel File Manager. You should see this:


TavoxPeru

Thanks a lot docduke, i just follow your tutorial and test your code and every thing works perfectly.

 

BTW, this is the first time that i use Imagemagick and to be honest it is awesome, i don't know that with it you can do a lot of incredible things with images.

 

Best regards,


yordan

ImageMagick is used by 4gallery photogallery. When you set up your site, it asks you where imagemagick is installed in your server. If not, you have to use gl libraries, which generally use too much memory.


actuary

Thank you very much for your kindly advice.

But it seemed to me that I can NOT see your last image you pasted.

 


iGuest

Hi docduke

I am getting the following error message

 

Version return code is 4

Do you know why this error?

I am using IIS8.1 windows


yordan

Invalid drive specification.

Do you know why this error?

Seems rather self-explanatory : you are pointing to a file on a drive which is not the one accessed by IIS8?



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.