Re: [PHP] strange errors from command line vs. web



Ok, dumb question but how do I do that? I know how to re-compile the
standard php. My code also uses mssql via freetds, does that somehow need
to be enabled as it doesn't seem to fail there.

Thanks!

On 9/28/06, Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@xxxxxxx> wrote:

Hi,

(sorry for top-posting)

This is the great way PHP-cli lets you know it hasn't got any MySQL
support :)

Enable that, and you're good to go. Mind you, PHP-cli has a separate
php.ini file.

Ivo



On Thu, 28 Sep 2006 08:26:13 -0400, blackwater dev wrote:
> Ok, I've set up a username and password using Grant All Privileges,
blah.
> with username and password. For some reason though the web now can't
login
> with that. I then changed the root db password and put that in the
config
> and the web side does run properly with that username, password. I
still
> can't run the script from the command line even when I su to root. I am
in
> a virtual hosting situation so not sure if that's it. Does it not know
what
> to do with localhost in a virtual hosting situation when running it from
the
> command line but does from the web? I'm trying to print the error but
it
> just seems to die:
>
> echo "about to connect";
> $this->connectionID= @mysql_connect($this->host, $this->user,
> $this->password);
> echo "after connect";
>
> From the command line, it never prints the after connect...just seems to
die
> without error...or at least no error to the screen and I do have a check
> right after to kick off the mysql error if there is no connection ID but
> again, I am su'ing to root so I thought it would always have
rights. Not
> really sure what to do next.
>
> Thanks!
>
> On 9/27/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
>>
>> On Wed, September 27, 2006 11:36 am, blackwater dev wrote:
>> > I have some code that makes a connection to the db. When I run this
>> > code
>> > from the command line, it stops at the db connection.
>>
>> Show us the code, without any embedded passwords, of course...
>>
>>
>> > If I call the
>> > script
>> > from the browser, it works fine.
>>
>> This almost always boils down to:
>> PHP runs as "nobody" or a similarly unpowered user
>> You log in as you, blackwaterdev or whatever, with many powers.
>>
>> In this case, it looks like 'nobody' has their own database, and is
>> allowed to connect to it, but you are not.
>>
>> > I've changed the permissions and
>> > that
>> > didn't work.
>>
>> Changed which permissions?
>>
>> mysql_admin?
>> If so, did you reload the permissions after change?
>>
>> File executable?
>>
>> What?
>>
>> > The db connection is the basic, localhost, root, with no
>> > password.
>>
>> Now that is an entirely separate problem.
>>
>> DON'T DO THAT!
>>
>> :-)
>>
>> > What else can I try?
>>
>> You're going to have to create a user and set a password anyway, so do
>> that first.
>>
>> There's no point in getting localhost/root/[blank] to work when it's
>> not what you want anyway.
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>>
>>

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




Relevant Pages

  • strange errors from command line vs. web
    ... I have some code that makes a connection to the db. ... from the command line, it stops at the db connection. ... The db connection is the basic, localhost, root, with no ...
    (php.general)
  • RE: Dialin problem
    ... # /etc/ppp/ppp.conf File for dial out modem to ISP and Dial in modem ... # connection to this FBSD system. ... # it's default options profile set to, NO command echo ATE0 and NO ... Edit /etc/ttys to enable a getty on the port where the dialin ...
    (freebsd-questions)
  • Re: [SLE] Setting up DSL on SUSE 10.1
    ... I won't faint at command line. ... SUSE or Mepis and the non computer oriented PCLinuxOS. ... In some OS's such as MS's the network will be confiured and on. ... on the DSL connection? ...
    (SuSE)
  • Re: System-users and-groups?
    ... bin shouldn't do so much. ... was root and bin... ... Although the daemon user/group are ... as that user runs that command. ...
    (alt.linux)
  • Re: More ASP.Net Newbie Questions
    ... The Command is then what you're doing with this connection, ... In regards to your final point, making grids and controls in general do ... > Connection and Recordset objects into, like, 37 different things. ...
    (microsoft.public.dotnet.framework.aspnet)