Re: [PHP] Execute EXE with variables

2009-02-18 Thread Yannick Mortier
2009/2/13 Dan Shirah mrsqua...@gmail.com:

  Use the system() command, and enclose both your command and its
 parameters in a pair of single quotes, as:

 system('mycmd -a alfa -b bravo');

 Paul
 --
 Paul M. Foster


 Using both exec() and system() I am getting the error: Unable to fork



This sounds to me like it is an restriction on the server that doesn't
allow php to fork so it could start another process.
Maybe you should ask your hoster if you are not allowed to do this.


-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me at twitter!
http://twitter.com/moortier

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Execute EXE with variables

2009-02-18 Thread Michael A. Peters

Yannick Mortier wrote:

2009/2/13 Dan Shirah mrsqua...@gmail.com:





Using both exec() and system() I am getting the error: Unable to fork




This sounds to me like it is an restriction on the server that doesn't
allow php to fork so it could start another process.
Maybe you should ask your hoster if you are not allowed to do this.




LOL - reminds me of a host I used that did not allow php to call exec()
So what I did was put the command into a database and had cron once a 
minute pop the database and run any commands it had in it.


After a week I got an e-mail notifying me my cron privileges had been 
revoked. So I went to a different host.


I don't remember what it was I was doing, but I do remember I later 
found a php module that allowed me to do it all in pure php (something 
image processing related).


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Execute EXE with variables

2009-02-14 Thread German Geek
Hi,

I've had a lot of problems with shell_exec too. Mostly it was permissions or
environment variables not being set. i dont know if there is a way to set
environment variables in the php.ini but if not you can set them with
shell_exec as well, at least on unix it works. You can simply concatenate
the commands necessary with a colon (;) inbetween. Maybe you can have
multiple shell_exec commands and it stays in the same env. Not sure about
this though. Please someone enlighten us on this...

Hope some of this helped.

Regards,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com
Jay London  - My father would take me to the playground, and put me on mood
swings.

2009/2/14 Dan Shirah mrsqua...@gmail.com

 
   Use the system() command, and enclose both your command and its
  parameters in a pair of single quotes, as:
 
  system('mycmd -a alfa -b bravo');
 
  Paul
  --
  Paul M. Foster
 

 Using both exec() and system() I am getting the error: Unable to fork



Re: [PHP] Execute EXE with variables

2009-02-14 Thread Ashley Sheridan
On Sun, 2009-02-15 at 00:16 +1300, German Geek wrote:
 Hi,
 
 I've had a lot of problems with shell_exec too. Mostly it was permissions or
 environment variables not being set. i dont know if there is a way to set
 environment variables in the php.ini but if not you can set them with
 shell_exec as well, at least on unix it works. You can simply concatenate
 the commands necessary with a colon (;) inbetween. Maybe you can have
 multiple shell_exec commands and it stays in the same env. Not sure about
 this though. Please someone enlighten us on this...
 
 Hope some of this helped.
 
 Regards,
 Tim
 
 Tim-Hinnerk Heuer
 
 http://www.ihostnz.com
 Jay London  - My father would take me to the playground, and put me on mood
 swings.
 
 2009/2/14 Dan Shirah mrsqua...@gmail.com
 
  
Use the system() command, and enclose both your command and its
   parameters in a pair of single quotes, as:
  
   system('mycmd -a alfa -b bravo');
  
   Paul
   --
   Paul M. Foster
  
 
  Using both exec() and system() I am getting the error: Unable to fork
 
I use the exec() function regularly and have no troubles passing more
than one argument to it. Admittedly, I've not tried this on a Windows
system, just a Linux one, and I was using exec() to call a Bash script,
which should behave like an exe I guess.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Execute EXE with variables

2009-02-13 Thread Paul M Foster
On Fri, Feb 13, 2009 at 02:30:38PM -0500, Dan Shirah wrote:

 Hello all,
 
 Can someone point me in the right direction?
 
 I'm trying to call an EXE from PHP and pass it two variables.
 
 I looked at the exec() command and I see that this can call the executable,
 but I don't see that it can pass the variables to it.
 

Use the system() command, and enclose both your command and its
parameters in a pair of single quotes, as:

system('mycmd -a alfa -b bravo');

Paul
-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Execute EXE with variables

2009-02-13 Thread Dan Shirah

  Use the system() command, and enclose both your command and its
 parameters in a pair of single quotes, as:

 system('mycmd -a alfa -b bravo');

 Paul
 --
 Paul M. Foster


Using both exec() and system() I am getting the error: Unable to fork