Fatal error: Call to undefined function mysql_connect
Patrick Newberry
PNewberry at habitat.org
Tue Feb 13 14:17:46 UTC 2007
--> What error exactly?
I'm getting the error message
Fatal error: Call to undefined function mysql_connect
When trying to bring a php page up and with code to connect to a mysql
database.
Now the odd thing is that I could type http://localhost/myfile.php in
the opera browser and it would open up and I could run the command
phpinfo(); without problem
However I could not do the same thing in firefox! Seem odd that local
host would work with one browser and not another on the same machine.
Like I said I was in the opera browser I was getting the message:
Fatal error: Call to undefined function mysql_connect However regular
echo statments worked just fine.
Ok so Then I just said heck, I'll start using the old apt-get
--reinstall install for the mysql modules per the dapper instructions.
Well when I finished Then I could not open my php script in either opera
or firefox! Well at least it was consistant!
I when to the apache2.conf file and commented out this line
AddType application/x-httpd-php .php
Then did the restart of apache but still I php scripts are not
executing.
Not sure if this means anything, but when I do the apache restart I get
the message:
* Forcing reload of apache 2.0 web server... apache2: Could not
determine the server's fully qualified domain name, using 127.0.0.1 for
ServerName
>
> You haven't said whether or not you've set up MySQL administrative or
> host access, or even checked to see if it's bound to a proper
> port:interface...
>
I have setup Mysql administrative and when I access that app thru the
gnome menu it comes up but when I attempt to access user admin it just
hangs up.
I can log in via a terminal session with mysql -u root -p and do the
updates and show database stuff.
> What's your /etc/mysql/my.cnf file have in it for a bind-address?
>
My bind address is the standard 127.0.0.1
> What does the output of 'netstat -tap' tell you about mysql, if
> anything?
Note: I noticed that when I bring up mysql administrator it defaults to
port 3306) it seems to connect but gets hung up when I try to do user
admin. I tried to use 3291 but still seemed need to fool with this a
bit more on my own.
anyway here is the netstat -tap results.
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 localhost:mysql *:*
LISTEN -
tcp 0 0 *:netbios-ssn *:*
LISTEN -
tcp 0 0 localhost:2482 *:*
LISTEN -
tcp 0 0 localhost:4662 *:*
LISTEN -
tcp 0 0 localhost:ipp *:*
LISTEN -
tcp 0 0 *:microsoft-ds *:*
LISTEN -
tcp 0 0 localhost:2653 localhost:2482
ESTABLISHED-
tcp 0 0 localhost:2482 localhost:2653
ESTABLISHED-
tcp 0 0 localhost:3291 localhost:mysql
ESTABLISHED10599/mysql-admin
tcp 0 0 localhost:mysql localhost:3291
ESTABLISHED-
tcp6 0 0 *:www *:*
LISTEN -
>
> What do the outputs of 'hostname' and 'hostname -f' say?
>
hostname -f
localhost
> Have you issued commands similar to these to set up MySQL?
>
I can connect no problem via mysql -u root password
do use database name and create tables etc.
Anyway, I guess number one issue I'll look at tommorow is why php
scripts are not being recognized by my browser but html files (via
localhost) are being recognized.
Pat
www.gypsyfarm.com
More information about the ubuntu-users
mailing list