Re: Exec as user
| From: | charlesk | Date: | Fri, 28 Dec 2001 14:41:06 +0000 |
| Subject: | Re: Exec as user | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78941@lists.php.net to get a copy of this message | ||
I tried echo %PATH% > test.txt and both the webpage and the dos prompt echo the correct path
information. This shows that a batch file executed by php can access the system vars. They have a
diffence only in accessing the %USERNAME% variable. Could this be indicative that it is running as
the system user? If so how do I change that?
Charles Killmer
---------- Original Message ----------------------------------
From: Mike Eheler <meheler@idearesource.com>
Date: Thu, 27 Dec 2001 16:56:21 -0800
Try doing this
<?
echo '<pre>';
print_r(array($HTTP_SERVER_VARS,$HTTP_ENV_VARS));
echo '</pre>';
?>
And see if the information you want is in there anywhere.
Mike
> I don't believe that the system variables are available to php. I work on
> *nix mostly, but I have a windows machine at home running php and I can't
> access any of my system var's.
> ----- Original Message -----
> From: "charlesk " <charlesk@netgaintechnology.com>
> To: <php-general@lists.php.net>
> Sent: Thursday, December 27, 2001 11:33 AM
> Subject: [PHP] Exec as user
>
>
>
>>I have been looking through the docs and found no help on either finding
>>
> which user the EXEC'ed commands run as, or how to specify which user they
> should run as. I tried exec, system, and passthru running a batch file that
> would write %USERNAME% to a file. And all three functions wrote nothing.
> They would however write "hello world". Has anybody else run into this.
>
>>I tried exec("test.bat");
>>test.bat:
>>echo %USERNAME% > test.txt
>>
>>when run from a command line it resulting in "Charles"
>>when run from a webpage it resulted in "ECHO is on."
>>if I added a line "echo off" above the echo username it resulted in "ECHO
>>
> is off." again only from the webpage.
>
>>In essense I need to update a DNS server through a web page. It works if
>>
> the script is local but not if it has to update a different server.
>
>>Charles Killmer
>>Windows 2000 Server, IIS 5.0, PHP 4.1.0
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>>For additional commands, e-mail: php-general-help@lists.php.net
>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>>
>>
>>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net