Jump to content

executing a program?


Jezza

Recommended Posts

I'm not sure what you mean. If you're meaning to execute an executable and output it in PHP you'd use something like this.. forgot the exact code..

 

$cal = @exec('cal');
echo '<pre>The date is:';
echo $cal;
echo '</pre>'

Link to comment
Share on other sites

That made absolutely no sense to me and just looking at it makes my head hurt, and it also looks like it outputs the result i don't want that, i pretty much want to simulate double clicking on a program, it opens up like that and doesn't wait for the program to finish up before it continues.

Link to comment
Share on other sites

I don't click to run programs under Linux, a desktop is just a wrapper. Within the shell, & puts a program into the background. In my example, foo was en example program. Could just as easily have been....

 

exec('someprogram &');

Link to comment
Share on other sites

If you trying to initialize a server as you siad, you should do it through a startup script. Take a look in your /etc/init.d directory for examples if there isn't already a script written for the server you are starting.

 

Then you would simply....

 

exec('/etc/init.d/nameofservice start');

 

and it will take care of putting the process into the background. Otherwise, the examples I have shown you should work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.