LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   mysql and apache not working quite right (https://www.linuxquestions.org/questions/linux-networking-3/mysql-and-apache-not-working-quite-right-306295/)

shortname 03-26-2005 09:49 AM

mysql and apache not working quite right
 
I have set up an apache server and added a module for php4, and these seem to be working okay. But now I seem to be having trouble with mysql. I am trying to set up the program web AimSniff, which uses php scripts to run, but when I attempt to view the file index.php (used by AimSniff) I get the following error:

Fatal error: Call to undefined function: mysql_connect() in /var/www/was/.global.php on line 5

I have no idea what this means or how to fix it.

P.S. Here is some information that may help you help me:

OS: SimplyMEPIS (Debian based distro)
Apache server: Version 1.3.33
Php: version 4.x <--not sure of exact version (4.3.10-9 I think)
Mysql: version 4.x <--not sure of exact version (4.0.24 I think)
Browser: Firefox

To the best of my knowledge, apache and the php module for apache are running correctly. The mysql server is also running, but as is evident, it doesn't appear to be working quite right. Either that, or I've configured something wrong for apache.

Thanks much,

Jeremy Davis Pedersen

paulsm4 03-26-2005 12:49 PM

The problem appears to be with your PHP installation.

a) Apache needs to talk to PHP, and
b) PHP needs to talk to mySQL, and
c) mySQL manages your data.

Please try the following:
1. Check your "phpinfo ();" output
2. Make sure you don't have a second, different
installation of PHP on your system
3. Consider re-building/re-installing PHP. Make sure you explicitly enable mySQL support (this *should* be the default)

'Hope that helps .. PSM

evil_empire 03-26-2005 03:47 PM

First of all configure php.ini to load mysql extension.
And then, you have to configure the mysql server name, database name, username, password properly on AImSniff script files. The file to make changes is /var/www/was/.global.php
Edit this file and make necessary changes.
Other things to consider,
Make sure mysql server is running.
A databse is created for AimSniff or whatever it is.

Plzz post back if you need further help.

paulsm4 03-26-2005 04:24 PM

Hi again, shortname. With all due respect to evil_empire, I think you're picking up a version of PHP that wasn't built to support mySQL. If that's true, modifying php.ini won't help at all - you'll need to either rebuild it, or find a pre-built binary with mySQL support.

This link might help clarify things:

http://us3.php.net/manual/en/ref.mysql.php

In any case, please:

1. Check your "phpinfo();" output.
2. Make sure you don't have some "rogue version" of PHP that your Apache server isn't picking up, instead of the one you intended.
3. Rebuild and reinstall (explicitly specifying "--with-mysql" in your "configure" script.

Your .. PSM


All times are GMT -5. The time now is 03:25 AM.