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

Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

P: n/a

Hi there!

I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the
mysqld daemon up and running. But when I look at the output of phpinfo() ,
I do not see it there, which is worrisome and so I tried to recompile PHP
and do ./configure with the --with-mysql=path but I don't really know
where my mysql's header files should be , is there any way to find that
out by using any of the mysql commands?

I did try to do ./configure for PHP4 without any parameters and when I
looked at the output, I do see that PHP seems to recognize that mySQL is
there :

....
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
checking for inline... (cached) inline
.....

Hence, why is that when I do phpinfo() , mySQL still doesn't show up?

I suspect that mysql isn't working correctly with php, because if I use
the mysql_connect() function in my php, I get the error "Fatal error: Call
to undefined function: mysql_connect() "
and yet it DOES seem like PHP recognizes mysql is there.

That "unable to recognize mysql_connect function" error comes up after
installing PHP using ./configure with or without any parameters.

Please help, thanks. I am pretty sure my MySQL is properly installed
because I can mysql into the server and set up my database

##-----------------------------------------------#
Article posted from PHP Freaks NewsGroup
http://www.phpfreaks.com/newsgroup
Get Addicted: comp.lang.ph
##-----------------------------------------------##
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
das dsf wrote:
Hence, why is that when I do phpinfo() , mySQL still doesn't show up? (snip) Please help, thanks. I am pretty sure my MySQL is properly installed
because I can mysql into the server and set up my database


Have you uncommented the line

;extension=mysql.so

in php.ini?
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #2

P: n/a
I did not see a line called extension=mysql.so , but I did see a commented
out line for extension=msql.so . Should I uncomment and rename it mysql.so
?

Moreover, I only found a php.ini-recommended file which is what I was
referring to from above.

"Pedro Graca" <he****@hotpop.com> wrote in message
news:sl*******************@ID-203069.user.uni-berlin.de...
das dsf wrote:
Hence, why is that when I do phpinfo() , mySQL still doesn't show up?

(snip)
Please help, thanks. I am pretty sure my MySQL is properly installed
because I can mysql into the server and set up my database


Have you uncommented the line

;extension=mysql.so

in php.ini?
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |

Jul 17 '05 #3

P: n/a
John top-posted [corrected]:
"Pedro Graca" <he****@hotpop.com> wrote in message
news:sl*******************@ID-203069.user.uni-berlin.de...
das dsf wrote:
> Hence, why is that when I do phpinfo() , mySQL still doesn't show up? (snip)
> Please help, thanks. I am pretty sure my MySQL is properly installed
> because I can mysql into the server and set up my database


Have you uncommented the line

;extension=mysql.so

in php.ini?


I did not see a line called extension=mysql.so , but I did see a commented
out line for extension=msql.so . Should I uncomment and rename it mysql.so
?


Try it :)
Moreover, I only found a php.ini-recommended file which is what I was
referring to from above.


The output of phpinfo() should tell you what php.ini your PHP is using.
So, find that file and make sure it has a line that enables MySQL.

--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #4

P: n/a
On 2 Jul 2004 09:22:31 GMT, Pedro Graca <he****@hotpop.com> wrote:
John top-posted [corrected]:
"Pedro Graca" <he****@hotpop.com> wrote in message
news:sl*******************@ID-203069.user.uni-berlin.de...
das dsf wrote:
> Hence, why is that when I do phpinfo() , mySQL still doesn't show up?
(snip)
> Please help, thanks. I am pretty sure my MySQL is properly installed
> because I can mysql into the server and set up my database

Have you uncommented the line

;extension=mysql.so

in php.ini?
I did not see a line called extension=mysql.so , but I did see a commented
out line for extension=msql.so . Should I uncomment and rename it mysql.so
?


Try it :)


No, don't try it. MSQL and Mysql are different databases. Not at all
compatable.
Moreover, I only found a php.ini-recommended file which is what I was
referring to from above.


The output of phpinfo() should tell you what php.ini your PHP is using.
So, find that file and make sure it has a line that enables MySQL.


Or compile php with the --with-mysql=/path/to/mysql set correctly.

--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #5

P: n/a
Gary L Burnore wrote:
On 2 Jul 2004 09:22:31 GMT, Pedro Graca <he****@hotpop.com> wrote:
John top-posted [corrected]:
I did not see a line called extension=mysql.so , but I did see a commented
out line for extension=msql.so . Should I uncomment and rename it mysql.so
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ^^^^^^^^


Try it :)


No, don't try it. MSQL and Mysql are different databases. Not at all
compatable.


--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #6

P: n/a
What distro are you using? I know I've had many hard times getting php
and mysql to play nice on redhat/fedora systems when using RPM's that
weren't fromt the distro (i.e. the RPM from mysql.com). The problem
was that the php rpm expected an older version of the mysql.so (I
think it was mysql.so.10 or maybe 11) and MySQL 4 and higher used a
newer version. That might be something to look into.
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.