note 82278 added to function.shell-exec
| From: | gabekon at gmail dot com | Date: | Thu, 03 Apr 2008 16:33:02 +0000 |
| Subject: | note 82278 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137900@lists.php.net to get a copy of this message | ||
RE: kamermans note,
I was having a similar problem with the PATH variable when using shell_exec. Even with a hard-coded
full path to a binary, I also got an error about a .so file that could not be found. After some
reading up, I realized I had to set the LD_LIBRARY_PATH variable:
<?php
$command = 'export LD_LIBRARY_PATH="' . $path_to_library_dir .'"; ' .
$path_to_binary;
shell_exec($command);
?>
Hope this saves someone a headache,
- G
----
Server IP: 64.71.164.2
Probable Submitter: 72.79.225.56
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- https://master.php.net/note/edit/82278
Del: integrated -- https://master.php.net/note/delete/82278/integrated
Del: useless -- https://master.php.net/note/delete/82278/useless
Del: bad code -- https://master.php.net/note/delete/82278/bad+code
Del: spam -- https://master.php.net/note/delete/82278/spam
Del: non-english -- https://master.php.net/note/delete/82278/non-english
Del: in docs -- https://master.php.net/note/delete/82278/in+docs
Del: other reasons-- https://master.php.net/note/delete/82278
Reject -- https://master.php.net/note/reject/82278
Search -- https://master.php.net/manage/user-notes.php