[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] PHP Guru needed
- Subject: Re: [cobalt-users] PHP Guru needed
- From: "Steve Werby" <steve-lists@xxxxxxxxxxxx>
- Date: Mon Jun 25 06:42:00 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
"Gavin Nelmes-Crocker" <gavin@xxxxxxxxxx> wrote:
> <?php
>
> #check new passwords are the same and then change password for user
> if ($password1==$password2) {
> $command1 = "/usr/bin/mysqladmin -u$user_name -p$old_passwd password
> $password1 ";
> system($command1);
> system("exit(0)");
> #$location= "home/sites/home/web/phpMyAdmin";
> #$command2 = "/bin/sed '/$old_passwd/s/$old_passwd/$password1/w gavin'
> /$location/config.inc.php.master ";
> #system($command2);
> #system("exit (0)");
> }
> header ("Location: ");
> ?>
>
> The commented out lines are the ones i can't get to work.
It seems as though you are trying to run the script through PHP as an Apache
module. Since Apache runs as an unprivileged user Apache (and your script)
won't have sufficient privileges to run some commands and edit many files.
If you don't mind affecting security by changing permissions and ownership
you can solve your problem, but it's advisable to instead install PHP as a
standalone CGI program, chown your scripts to a user privileged to do what
you want and run them as CGIs. In your case, to run mysqladmin you'll
likely need the script to be owned by mysql or root depending upon the owner
of that binary.
> Please contact me off list if you have the answer.
Since my response can benefit other list members, I chose to respond
on-list. That's a personal rule of mine.
> ps I know it looks silly someone from cobalt asking a question like this
but
> I'm doing this myself.
Not silly at all. I think we all realize if Cobalt engineers were a
collection of all-knowing super-humans...well, they wouldn't be working at
Cobalt. Not a bash on Cobalt, just a reminder that the best employee at the
best company still has unlimited room to grow.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/