By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,642 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,642 IT Pros & Developers. It's quick & easy.

Executables in PHP

P: n/a

Hi,

I want to execute shell command in php. I tried successfully the following:
<?php
$output = `ls -al`;
echo "<pre>$output</pre>";
?>

However when I want to launch an application like
<?php
$output = `open /Applications/myApplication.app`;
?>

Nothing appears while when I type open /Applications/myApplication.app in
the Terminal window, myApplication is launched properly.

I have the same problem with a cli application passing parameters:

<?php
$output = `./myApplicationcli param1 param 2`;
echo "<pre>$output</pre>";
?>

I see in the web browser that the application run, but nothing is saved !
while in terminal, the application works fine

Thanks for helping me

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 30 Oct 2003 11:28:28 +0100, Yves Peysson <pe*****@drfc.cad.cea.fr>
wrote:
I want to execute shell command in php. I tried successfully the following:
<?php
$output = `ls -al`;
echo "<pre>$output</pre>";
?>

However when I want to launch an application like
<?php
$output = `open /Applications/myApplication.app`;
?>

Nothing appears while when I type open /Applications/myApplication.app in
the Terminal window, myApplication is launched properly.

I have the same problem with a cli application passing parameters:

<?php
$output = `./myApplicationcli param1 param 2`;
echo "<pre>$output</pre>";
?>

I see in the web browser that the application run, but nothing is saved !
while in terminal, the application works fine


PHP runs under the web server process, which will have a different environment
and permissions to your terminal.

Check PATH, environment variables, and filesystem permissions.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.