473,499 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 17 '05 #1
2 1734
dave <dm*******@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.
Jul 17 '05 #2
ilo
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
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2077
by: Erik | last post by:
I understand, that PHP4 has a MySQL client built in. I was warned, that this client does not support the MySQL 4.1.1 system, which I installed on my RH9 box end that I need to install that version...
2
2557
by: pancho | last post by:
Greetings, I need help configuring/building PHP3 with MySQL as a DSO on a Solaris 8 box - this module is needed to host some existing sites I will be migrating Note. I built PHP4 from source and...
1
1952
by: porneL | last post by:
I've had setup on WinXP: Apache1.3 with PHP4 module and PHP5 installedas CGI for one vhost. This worked fine, till I installed Zend Studio 4 beta. I'm trying to make Zend Server use my...
3
2095
by: Klaus Hansen | last post by:
Hi all Using Windows XP, PHP4.3.11 and Mysql 4.1. Im a newbie to PHP and Mysql. Im trying to connect to the database with this script: <?php //list_db.php
0
1161
by: dave | last post by:
Hello, I'm trying to do some database work on an rh9 box. I installed httpd2, mysq, mysql-server, and php4. I'm having difficulties connecting to a database via a web page. I'm not sure if i...
4
1786
by: Andy Baxter | last post by:
hello, I'm using the php4-mysql module with php4 under debian linux (sarge). I have a script, schedule.php, which runs fine when I invoke it from the command line, but fails with the error: ...
1
1378
by: Auddog | last post by:
I'm wanting to work with php4 and want to know which version of mysql to download that works great with php4 api version 3.23.x? Thanks for any help you can provide. A
3
2936
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
0
1126
by: doctorhardik | last post by:
hai all i have Fedora3. i am trying to configure mysql5.0.1 with php4.3.9. when i configure php with --with-mysql=shared,/usr i get mysql.so file. but in phpinfo page i am not find mysql. ...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.