WebFaction
Community site: login faq

Hello, I am trying to get imagemagick working, and can't quite figure it out. I followed the directions for for installing, and everything looks fine, as in the commands are accessible from the command line, but I can't access the functions from by website. if I write a phpinfo() file, imagemagick does not show up, so I think it is a path problem. How do I get imagemagick, currently in ~/bin on my apache path? I tried using the application panel, and then putting a php.ini file in the created directory, but that didn't do anything.

thanks, maria

asked 24 Jan '13, 19:07

mariak
111
accept rate: 0%


I believe you should be able to do this using putenv() to set the PATH environment variable. For example, something like:

putenv('PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/username/bin')

at the beginning of your PHP application code, so that subsequent calls to imagemagick find this on your PATH, in this case in the last entry (inside /home/username/bin, where username is your username).

permanent link

answered 25 Jan '13, 02:15

ryans ♦♦
5.0k93360
accept rate: 43%

This isn't working for me. I tried it with a little test file:

<?php
putenv('PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mariak/bin');
phpinfo();
if (extension_loaded('convert'))
  {
    echo "yes, convert exists";
  }
else
  {
    echo "no, imagemagick probably not installed";
  }
?>

When I load the page, the PHP info gives no info about imagemagick, and I get the no, imagemagick probably not installed. You can see the page here http://www.mariakathryn.net/test.php

From the command line, it works fine. Interestingly, there do seem to be some imagemagick tools in /usr/bin, but obviously I'm not seeing those either.

(25 Jan '13, 13:59) mariak

Just noticed it scrubbed my code, but you can see it by looking at source of the link.

(25 Jan '13, 18:45) mariak

I just fixed the code in your comment (it needed to be indented).

(25 Jan '13, 19:08) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×19
×11

question asked: 24 Jan '13, 19:07

question was seen: 2,603 times

last updated: 25 Jan '13, 19:09

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM