Re: Can't execute external program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > Here is the php I've created, fairly simple:
> > <?php
> > exec("/var/www/html/myprog -E 123456789098.dat sample1.txt
> > sample1.new");
> > phpinfo();
> > ?>

> > From the command line it runs perfectly

A PHP script runs with the permissions of the user that Apache 
runs as, usually "nobody".  When run from the command line, it 
inherits a different set of permissions (i.e., root).

One option would be to put a copy of the executable in another 
directory, but OUTSIDE of your DOCROOT, and give it the same
ownership and perms as "nobody" (or whatever Apache runs as).

Of course, this makes your script 100% non-portable, if that 
matters.  It is also possible that the executable may not run, if it 
depends on compiled libraries elsewhere on the server.

************************************************************
WebDesigns Internet Consulting
E-commerce Solutions
Application Development

Sandy Keathley
Zend Certified Engineer
sandy@xxxxxxxxxxxxxxxx
972-569-8464

http://www.KeathleyWebs.com/
************************************************************

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux