473,471 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Executables in PHP


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
1 1652
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Hemanth | last post by:
Hello there, I'm new to PHP. I'm trying to run a simple php script (on a Red hat linux machine with apache web server ) through a windows web browser (IE). I'm using an exec() function in my...
2
by: Jubril Oyesiji | last post by:
Does anyone have an idea about how to convert Java Class files into Windows Executables (.Exe) except writing a Batch file
9
by: mac | last post by:
when a c program is compiled using 'gcc test.c' 'cannot create c executables is thrown' I cannot able to figure out the problem could anyone help me. Thanks.
20
by: | last post by:
Back in the Old days, I compile a C++ executable, copy the dll's used by this executable to the same folder. Go to another computer, copy that folder locally, double click on the exe file and off...
2
by: ven | last post by:
I have used C# binary formatter to serialize and deserialize a data structure. However, for the same data format( used by the first executable, the same *.CS files), the second executable gives an...
5
by: VJ | last post by:
I have one VB.NET project, that outputs a "Mycomapny.exe" everytime I do a build. But I need it to output 4 different executables everytime I build. How do I archive this. I am looking at the...
1
by: Water Cooler v2 | last post by:
I have a Windows Service I am writing in C# and a set of, let us say three, other executables written in C# (mostly console applications). I want that the Windows Service must do so every few...
0
by: A W | last post by:
Hello, I am encountering the following scenario while compiling a project under Visual Studio 2005 with the floating point model set as precise. Two executables A and B share a common dll C. ...
4
by: ravit | last post by:
I have built my gdb-6.7.1 yesterday on my AIX 5.3 64 bit machine. my gcc is gcc3.3.2 and tried debugging 64 bit executables generated by gcc, working fine. debugging session ends successfully....
6
by: =?Utf-8?B?Q2hhcmxlcyBS?= | last post by:
I have two different executables that I want to build w/ the same source but in 2 different compilers, vs60 and vs2008. I have 2 different configurations w/ different options etc, but I want one...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.