Wierd PHP/MySQL problem 
Author Message
 Wierd PHP/MySQL problem

Hey all...

I am also posting this on a MySQL list, as I don't know where the
problem is localized...

Here's one that really has me stumped.  I have a Cobalt RAQ 550, with
MySQL and PHP 4.0.6.  I also have phpMyAdmin installed, for ease-of-use
for our customers to set up their databases.  This works pretty well,
although I have found what I consider to be a bug with it but it does
not have a bearing on this particular issue.

Now, the problem is that a non-authenticated (via htaccess) user does
not seem to be able to parse anything from the databases, even tho the
"'' user % host" user has select rights to that database.  For instance,
  I built a small php script that does a phpinfo() and then a "select *"
from a table in the customer's database.  This file was placed in two
places: in the root directory and in the phpmyadmin directory (which
requires htaccess username/password authentication to get to).  Here's
the differences:

1. The select * data shows up in the phpmyadmin realm, but I get an
error "Fatal error: Call to undefined function: mysql_connect() in
/home/.sites/143/site2/web/testphp.php on line 13" at the root directory.

2. The phpinfo() shows the mysql section in the phpmyadmin realm but not
at the root directory.

Does anyone have any idea why this is acting the way that it is?  The
Cobalt is a factory default installation (it's a SunCobalt), and is
about 2 months old.  There are no SunCobalt updates that I see that will
affect this issue.

Thanks for any thoughts or ideas...

Alex



Sat, 21 May 2005 22:34:26 GMT  
 Wierd PHP/MySQL problem

Quote:

> Now, the problem is that a non-authenticated (via htaccess) user does
> not seem to be able to parse anything from the databases, even tho the
> "'' user % host" user has select rights to that database.  For instance,
>   I built a small php script that does a phpinfo() and then a "select *"
> from a table in the customer's database.  This file was placed in two
> places: in the root directory and in the phpmyadmin directory (which
> requires htaccess username/password authentication to get to).  Here's
> the differences:

> 1. The select * data shows up in the phpmyadmin realm, but I get an
> error "Fatal error: Call to undefined function: mysql_connect() in
> /home/.sites/143/site2/web/testphp.php on line 13" at the root directory.

> 2. The phpinfo() shows the mysql section in the phpmyadmin realm but not
> at the root directory.

> Does anyone have any idea why this is acting the way that it is?  The
> Cobalt is a factory default installation (it's a SunCobalt), and is
> about 2 months old.  There are no SunCobalt updates that I see that will
> affect this issue.

Just a thought, are you sure you are using the same FQDN in both URLS?

For example,

http://www.freakinexample.com

and

http://freakinexample.com

I have made boo-boos in the past with regards to host headers, either
forgetting to set them up in DNS or httpd.conf, or making a typo.

Usually I set up either an A record in DNS with a CNAME pointer or just two
A records for both FQDNs. Additionally, in httpd.conf <VirtualHost> I set
ServerName and ServerAlias.

If something is incorrect then there is a chance that the URL without "www"
is going to a different place. Normally the php configuration encompasses
all VirtualHosts and the Default server however it is possible that in your
case this isn't true.

I realize this is a bit off the wall, however your particular issue indeed
seems peculiar.

I'll think about it some more...

Take care,

--
Waitman Gobble         EMK Design     Buena Park, California

Public Key                          http://pgp.emkdesign.com
Find an example                    http://freakinexample.com



Sun, 22 May 2005 11:22:10 GMT  
 Wierd PHP/MySQL problem
Here's the answer to your "wierd" problem:
http://www.m-w.com/cgi-bin/dictionary?va=wierd
Quote:

> Hey all...

> I am also posting this on a MySQL list, as I don't know where the
> problem is localized...

> Here's one that really has me stumped.  I have a Cobalt RAQ 550, with
> MySQL and PHP 4.0.6.  I also have phpMyAdmin installed, for ease-of-use
> for our customers to set up their databases.  This works pretty well,
> although I have found what I consider to be a bug with it but it does
> not have a bearing on this particular issue.

> Now, the problem is that a non-authenticated (via htaccess) user does
> not seem to be able to parse anything from the databases, even tho the
> "'' user % host" user has select rights to that database.  For instance,
>   I built a small php script that does a phpinfo() and then a "select *"
> from a table in the customer's database.  This file was placed in two
> places: in the root directory and in the phpmyadmin directory (which
> requires htaccess username/password authentication to get to).  Here's
> the differences:

> 1. The select * data shows up in the phpmyadmin realm, but I get an
> error "Fatal error: Call to undefined function: mysql_connect() in
> /home/.sites/143/site2/web/testphp.php on line 13" at the root directory.

> 2. The phpinfo() shows the mysql section in the phpmyadmin realm but not
> at the root directory.

> Does anyone have any idea why this is acting the way that it is?  The
> Cobalt is a factory default installation (it's a SunCobalt), and is
> about 2 months old.  There are no SunCobalt updates that I see that will
> affect this issue.

> Thanks for any thoughts or ideas...

> Alex



Mon, 23 May 2005 12:59:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. php mysql sample code php shareware like KB knowledgebase

2. PHP+MySQL vs. PHP+PostgreSQL

3. php + mysql or php + postgresql?

4. PHP/MySQL Problem

5. Problem using MULTIPLE FUNCTIONS in mySQL/php query

6. Annoying problem with php and mysql

7. PHP and MySQL Problem

8. Problem compiling PHP 4.3.1 with UnixWare 7.1.3, APACHE 1.3.27, Mysql 3.23.55

9. mysql fetch problem with php

10. php+mysql INSERT problem

11. problem with select output with PHP/MySQL

12. mySQL/PHP problem

 

 
Powered by phpBB® Forum Software