RE: [PHP] How can you execute UNIX scripts from PHP
| From: | Rea_David at emc dot com | Date: | Tue, 18 Feb 2003 14:38:50 +0000 |
| Subject: | RE: [PHP] How can you execute UNIX scripts from PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136010@lists.php.net to get a copy of this message | ||
My mistake Kevin, I did not put the full path of the shell script into the
$script variable.
Thanks very much for your help
Dave
-----Original Message-----
From: Rea_David@emc.com [mailto:Rea_David@emc.com]
Sent: 18 February 2003 14:21
To: kevin@oceania.net; php-general@lists.php.net
Subject: RE: [PHP] How can you execute UNIX scripts from PHP
Hi Kevin,
Thanks very much for your reply, but I'm having no luck with it. In
the test that I'm doing, I'm using the same code as you provided. It's on a
Solaris system & the permissions & ownership of the shell script is correct.
The shell script is also located in the same directory as the php file. All
the shell script is doing is creating a file & works grand when run from the
command line. Have you any ideas/thoughts on this? I'd really appreciate it!
Thanks
Dave
-----Original Message-----
From: Kevin Waterson [mailto:kevin@oceania.net]
Sent: 18 February 2003 13:26
To: php-general@lists.php.net
Subject: Re: [PHP] How can you execute UNIX scripts from PHP
This one time, at band camp,
Rea_David@emc.com wrote:
> Hi everyone,
>
> How can you execute UNIX scripts from PHP. If somebody could let me
> know it would be great.
if you have a shell script called blah.sh
$script = 'blah.sh';
exec($script);
system($script); // my favourite
or if you like you could do
blah.sh // backticks
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php