Nov 21, 2009

Imagemagick And Php, Help

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Imagemagick And Php, Help

malum
I am running a PHP based web site and have just moved to a Windows server
I can't get Imagemagick to work in PHP.
It works from the command line.

I don't have access to the server other than a simple control panel but I can pass info onto the administrator (who also happens to be my buddy)

running the test page gives me this

Warning: exec() [function.exec]: Unable to fork [convert -version] in D:\home\Customers\virtuallyinsane.com\htdocs\test\test.php on line 11
Version return code is -1


test being

CODE
<html> <head> <title>Test for ImageMagick</title> </head>
<body> <br />
<b>Warning</b>:  exec() [<a href='function.exec'>function.exec</a>]: Unable to fork [convert -version] in <b>D:\home\Customers\virtuallyinsane.com\htdocs\test\test.php</b> on line <b>11</b><br />
Version return code is -1 <br><ul></ul> </body> </html>


The web based php script has a page to put the path in for Imagemagick but when I do it can't find it, it tell me the path isn't valid (my admin says I shouldn't need the path anyway as it should work from anywhere)

Any help appreciated

 

 

 


Comment/Reply (w/o sign-up)

yordan
malum,
You first posted this topic in the "tutorial" forum.
Your post is not really a tutorial, looks more like a call for help. huh.gif
That's why I moved your topic here, where it should most probably have an answer.
By the way, I hate this "cannot fork", looks like a memory access or number of process problem.
Are you sure that your program should run from the command line ? What happens if you try to run it in a window ?

Comment/Reply (w/o sign-up)

docduke
Here is a test of ImageMagick with more output details:
CODE
<html> <head> <title>Test for ImageMagick</title> </head>
<body> <?
function alist ($array) {  //This function prints a text array as an html list.
  $alist = "<ul>";
  for ($i = 0; $i < sizeof($array); $i++) {
    $alist .= "<li>$array[$i]";
  }
  $alist .= "</ul>";
  return $alist;
}
exec("convert -version", $out, $rcode); //Try to get ImageMagick "convert" program version output.
echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of "convert -version"
?> </body> </html>
It defines a php function "alist" that parses the output of the "version" query and formats it so that a browser can display it.

Copy and paste this code into a .php file and upload it to somewhere that it can be accessed by your (PHP-supporting) web server. Then load it into a browser. It should tell you just about everything that ImageMagick knows about its environment.

I put a tutorial up on it a while ago: How To Find And Test Imagemagick Using Php. If that doesn't help enough, take a look at Basic Usage on the ImageMagick website. By the way, when you do your command-line check, note whether the version number is above or below 5.5.7. There was a significant change in the way it processes arguments at that point.

Hope this helps! cool.gif

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Imagemagick Php

  1. Should This Great Site Offer Imagemagick ? - May be the admin of this site think over it. (3)
  2. Help Me With Php And Imagemagick - do you know a path to imagemagic??! (2)
    Hello all, ok so this is really simple problem but I don't know how to solve it. Im making
    gallery on my web so I want to install one PHP script that uses imagemagic to make automatic
    thumbnails. Now, I searched thru astahost's forums, and everyone knows that astahost is
    supporting imagemagick and gd2 but why the heck when I try to run my php script I get this: CODE
    GD library is not installed or this CODE /usr/bin/convert - no such file bla bla...
    So, anyway, after short analysis I figured out that I need a full path to IMAGEMAGICK, and ...



Looking for imagemagick, php,

See Also,

*SIMILAR VIDEOS*
Searching Video's for imagemagick, php,
advertisement



Imagemagick And Php, Help

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com