php4 and mysql on rh9 not cooperating

This is a discussion on php4 and mysql on rh9 not cooperating within the PHP Language forums, part of the PHP Programming Forums category; Hello, I'm trying to get php4, apache2, and mysql3.23 to work on an rh9 machine. I've installed ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2004
dave
 
Posts: n/a
Default php4 and mysql on rh9 not cooperating

Hello,
I'm trying to get php4, apache2, and mysql3.23 to work on an rh9 machine.
I've installed those packages via rpm during the install. If i load this in
a page:
<? phpinfo(); ?>
and call it test.php then browse to it, i get php output. In that output it
is confirmed that mysql support is enabled.
When i installed mysql i ran:
mysql_install_db
then set a password for the root user. I then logged in as the root user and
ran a grant command for a database i'll call example:

mysql -p
entered the root password:
GRANT ALL PRIVILEGES ON example.* TO
DataBaseUser@localhost
IDENTIFIED BY 'password';

this returned no errors. Again, from the mysql commandline i can log in as
this user, and use the database. I can query it, and add/delete information
from it. My problem comes when i try to access the database via a web page,
both httpd and mysql are on the same box, and i get an access denied
message. Here's my connect string:

$connection = mysql_connect("localhost","DatabaseUser","password ");
mysql_select_db("example", $connection);

and when i load the page i get the can not connect, access denied.
Suggestions welcome.
Thanks.
Dave.


Reply With Quote
  #2 (permalink)  
Old 01-17-2004
steven
 
Posts: n/a
Default Re: php4 and mysql on rh9 not cooperating

dave <dmehler26@woh.rr.com> wrote:
> Hello,
> I'm trying to get php4, apache2, and mysql3.23 to work on an rh9 machine.
> ...
> this returned no errors. Again, from the mysql commandline i can log in as
> this user, and use the database. I can query it, and add/delete information
> from it. My problem comes when i try to access the database via a web page,
> both httpd and mysql are on the same box, and i get an access denied
> message. Here's my connect string:
>
> $connection = mysql_connect("localhost","DatabaseUser","password ");
> mysql_select_db("example", $connection);


you should start by analyzing your log files (usually in /var/log) to
figure out what is going wrong. in httpd.conf, turn on warning and error
displaying/logging if it's not activated already.
i have no experience with rh9 but maybe your apache is running in a chroot
environment for security? (a kind of jail outside which the web server
cannot access anything). in that case, you can try one of the following
(the last option seems best from a security point of view.)
- disable the chroot (check apache documentation)
- use '127.0.0.1' instead of 'localhost' to connect,
- create a softlink to the mysql socket (mysql.sock) in the chroot
directory and copy /etc/hosts and /etc/resolv.conf to the chrootdir
(usually /var/www, so the files become /var/www/etc/hosts etc.)

hope this helps,
steven.
Reply With Quote
  #3 (permalink)  
Old 01-18-2004
ilo
 
Posts: n/a
Default Re: php4 and mysql on rh9 not cooperating

Unfortunately I dont have the solution for you but I have an advice.
Try to install this http://www.webmin.com/ and you will have a better
understanding on what process is running and you will have easier access to
add user in mysql.

Hope it helps

ilo
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0