RE: [PHP] re: exec()
| From: | Anthony Martin | Date: | Wed, 06 Dec 2000 15:57:51 +0000 |
| Subject: | RE: [PHP] re: exec() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28922@lists.php.net to get a copy of this message | ||
Try this:
<?
$output =
/usr/sbin/apachectl restart ;
echo $output ;
?>
Those are back ticks, not single quotes. They are interpolated too, so this
would work too:
<?
$action = 'restart' ;
$output = /usr/sbin/apachectl $action ;
echo $output ;
?>
Fun stuff.
Anthony
-----Original Message-----
From: Ubaidul Khan [mailto:aa9869@wayne.edu]
Sent: Wednesday, December 06, 2000 6:28 AM
To: php-general@lists.php.net
Subject: [PHP] re: exec()
I was trying to use the exec() function to execute a external unix command,
and store the output into an array, following is my syntax:
<?php
$httpd = exec("/usr/sbin/apachectl restart", $output);
$httpd;
echo $output;
?>
echo $output;
^
|
Does not produce any output.
Please help, if you know how to use the exec() function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ubaidul Khan
Senior System Administrator
Library System and Technical Services
Wayne State University
Fax: 313-577-8720
Phone: 313-577-4008