By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,016 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,016 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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.

Jul 23 '05 #2

P: n/a
la***@portcommodore.com wrote:
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.


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.
Jul 23 '05 #3

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

php ./test.php


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

Florent
Jul 23 '05 #4

P: n/a
Florent Clairambault wrote:
What is weird however (at least I think) is when I run the following
via telnet:

php ./test.php

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

Florent


How do I include it in my PHP Apache Module?
Jul 23 '05 #5

P: 1
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!!
Aug 5 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.