Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199903

[PHP3] exec() problem (newbie) From: Milen A. Radev (milenr <email protected>)
Date: 03/18/99

Hi, folks!

I wrote a script which updates a old-fashioned full-text database.
It calls two other SHELL scripts do do the real job:

$commandline = "./copyiso.sh $userfile_name $database";

if(exec($commandline)!=0) {
  echo "Unable to update<br>\n";
  exit;
 }

The content of (for example) copyiso.sh is:

./mx iso=$1 copy=$2 -all now tell=100

I didn't work.
I tried to call the the program mx directly from the PHP script like
this:

$commandline = "./mx iso=$userfile_name append=$database -all now
tell=100";
if(exec($commandline)!=0) {
  echo "Unable to update<br>\n";
  exit;
 }

I didn't work also.

Before the exec() call I chdir to the shell scripts directory because
it is not in the PATH:

$workdir = "/usr/local/apache/cgi-bin/wwwisis/";
if(!chdir($workdir)) {
  echo "Unable to change to directory <br>\n";
  exit;
 }

The mentioned shell scripts and programs are world executable
(-r-xr-xr-x)
and so the directory where they are placed.

Any ideas?

Thank you.

Milen A. Radev
MT-Link

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>