Connecting Tech Pros Worldwide Forums | Help | Site Map

Another "Fatal error: Call to undefined function: mysql_connect()"Question

Grant Nosbush
Guest
 
Posts: n/a
#1: Jul 23 '05
I have searched the newsgroups and the web trying to solve this problem
and just can't get it. Maybe someone will be able to help. I am
getting the following error when I try to view a test page in my
browser. This test page just reads a table in mysql and outputs the
results.

Fatal error: Call to undefined function: mysql_connect() in
/var/web/public/test.php on line 2

I'm using:
Apache 2
MySQL 4.1.12
PHP 4.4.0

I have tried upgrading PHP to PHP5. I went back down to PHP4. I
verified that mysql.so was being loaded. I tried using the OLD_PASSWORD
feature in mysql. Verified that the PHP module is loaded in apache.

What is weird however (at least I think) is when I run the following via
telnet:

php ./test.php

It pulls up the page, connects successfully to the database and displays
the records. No error message.

Does anyone have any suggestions for other things for me to try. Thanks
in advance for your help.

Grant

larry@portcommodore.com
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Another "Fatal error: Call to undefined function: mysql_connect()"Question


Do you have MYSQL loaded and setup to sartup in your startup init - it
is not setup automatically to do so in some distributions. I usually
get that when the service is not running.

Grant Nosbush
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Another "Fatal error: Call to undefined function: mysql_connect()"Question


larry@portcommodore.com wrote:[color=blue]
> Do you have MYSQL loaded and setup to sartup in your startup init - it
> is not setup automatically to do so in some distributions. I usually
> get that when the service is not running.
>[/color]

Yes, MySQL does start at boot time and is running. As I mentioned in my
post, when I run PHP from the command prompt, it connects and pulls
data. It gives me this error message when I try to load the page via a
web browser.
Florent Clairambault
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Another "Fatal error: Call to undefined function: mysql_connect()"Question


[color=blue]
> What is weird however (at least I think) is when I run the following via
> telnet:
>
> php ./test.php[/color]

mysql is included in you PHP-CGI configuration but not in you PHP Apache
Module.

Florent
Grant Nosbush
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Another "Fatal error: Call to undefined function: mysql_connect()"Question


Florent Clairambault wrote:[color=blue]
>[color=green]
>> What is weird however (at least I think) is when I run the following
>> via telnet:
>>
>> php ./test.php[/color]
>
>
> mysql is included in you PHP-CGI configuration but not in you PHP Apache
> Module.
>
> Florent[/color]

How do I include it in my PHP Apache Module?
Newbie
 
Join Date: Aug 2005
Posts: 1
#6: Aug 5 '05

re: Another "Fatal error: Call to undefined function: mysql_connect()"Question


Hello:

I'm new to php and mysql I'm working on debian woody with php 4.3 and mysql 4.0. I cant change versions since the program I'm installing requires exactly those I get this same error but when i try to exec the php scrit thru a shell this is wht it returns:
php(507): unaligned access to 0x2000000001779a2c, ip=0x4000000000297a90

What con u tell me about this. And of course the browsers dont work either.

BTW how do I load mysql.so to the apache,cgi, and cfi configs of php.ini. Is it just by adding extension=mysql.so?

Thanks!!
Closed Thread