apache2 env path
Ryan Schmidt
ryandesign at macports.org
Wed Jan 7 16:57:50 PST 2009
On Jan 6, 2009, at 09:25, sheldon wrote:
> I'm using apache2 installed and running via macports in /opt/local.
> I'm using
> php to run a exec() function via a script and would like to set the
> path apache
> has access to so I can run ImageMagick commands to convert images
> via php. Since
> ImageMagick was installed via macports too, it's executables are
> outside the
> default path (which seems to be only /bin:/sbin:/usr/bin:/usr/sbin)
> and I need
> to be able to set apache's running path. Can Anyone please help?
Can you just specify the absolute path to ImageMagick? It works for me:
<html>
<head>
<title>identify</title>
</head>
<body>
<?php
exec("/opt/local/bin/identify 2>&1", $output, $error_code);
if ($error_code) {
"Error $error_code occurred<br />\n";
}
echo nl2br(htmlspecialchars(implode("\n", $output)));
?>
</body>
</html>
More information about the macports-users
mailing list