Re: Execute EXE with variables
| From: | Ashley Sheridan | Date: | Sat, 14 Feb 2009 12:15:49 +0000 |
| Subject: | Re: Execute EXE with variables | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-288252@lists.php.net to get a copy of this message | ||
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 <mrsquash2@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