Re: add to .htpasswd via php
| From: | Joseph Koenig | Date: | Wed, 02 May 2001 18:13:47 +0000 |
| Subject: | Re: add to .htpasswd via php | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51179@lists.php.net to get a copy of this message | ||
My code looks very similiar to Tyrone's...here's what I'm using. When
I'm on command line I'm the same user as the web server is running as.
$username = "test2";
$password = "test";
$passfile = "/usr/home/myuser/etc/.htpasswd";
$addpass = "/usr/local/apache/1.3.12/bin/htpasswd -mb $passfile
$username $password";
$add = exec($addpass);
Anyone see anything stupid I'm missing? Thanks,
Joe
Tyrone Mills wrote:
>
> I do this exact thing on my system, here is the code I use:
>
> $update = exec ("/usr/local/apache/bin/htpasswd -b ./.htpasswd $username $password");
>
> My guess is you are dealing with a permissions issue. Like Jack says, try 'su nobody'
> (or whatever your webserver runs as) and then try the command... Once that works, so will your
> script.
>
> ----- Original Message -----
> From: "Jack Dempsey" <dempsejn@georgetown.edu>
> To: <php-general@lists.php.net>; <joe@jwebmedia.com>
> Sent: Wednesday, May 02, 2001 10:44 AM
> Subject: RE: [PHP] add to .htpasswd via php
>
> > what user are you running the command on the the command line, and what user
> > is php running it as? if you're root for the first one, but nobody on the
> > second, that would be your problem...
> >
> > -jack
> >
> > -----Original Message-----
> > From: Joseph Koenig [mailto:joe@jwebmedia.com]
> > Sent: Wednesday, May 02, 2001 1:40 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] add to .htpasswd via php
> >
> >
> > I'm attempting to streamline my work by writing a script that will add a
> > user to the .htpasswd file. If echo the command I'm sending (via exec())
> > and run it on the command line, it works fine. From php though, it does
> > nothing. All paths are full paths starting at server level. Is there
> > anything that anyone is familiar with that would cause this to not work?
> > Thanks,
> >
> > Joe
> >
> > --
> > 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
> >