Forum Moderators: coopster

Message Too Old, No Replies

mysql_connect() still undefined =/

solved the problem... hope to get help understand though lol

         

Aftek

7:47 pm on May 12, 2006 (gmt 0)



I have been through this thread [webmasterworld.com] already about this subject...

I am running the same as mikejson except for
MySql, im running 5.x

So after reading the thread, i found out i wasn't editing the right php.ini either...
i too had C:\WINDOWS showing with phpInfo()

and by that time, whenever using mysql_connect
i was getting the error output.

Once i got my php.ini file to be recognize..
(dumb, i had followed the same tutorial and put C:\PHP)

--PAUSE--

ALRIIIIIIIIIIIIIGHT, i solve my problem...
i figured i would post it anyway if it can help someone...

FIRST:

my problem was when using mysql_connect()
i was getting FATAL ERROR: call to undefined function mysql_connect()
even though php_mysql.dll extension was uncommented.

SECOND:

i then went through this thread [webmasterworld.com] to find out that:
- the php.ini file where i uncommented the extension wasnt being used
(phpInfo() showed C:\WINDOWS for php.ini path.. with means not found and using default)
- PHPIniDir "C:\PHP" in apache httpd.conf stopped it from looking into environment variable.
(in the thread i read about it, he solved it with "./" i actually had to specify the path where it is... "./" would stop apache from starting)
- The thread also had me make sure i had libmysql.dll in my C:/WINDOWS/System32 folder

THIRD:

After this, phpInfo() was showing the correct path to my php.ini file
( which should be X:/path/php.ini )
By then when using mysql_connect() wouldnt work still...
but i wouldnt have the error anymore..
i thought it was solved for a second
and unfortunatly i had simply turned off error reporting in my php.ini file

so turning it back on to debug,
i got the FATAL ERROR again.
at least i had control over my php configuration file.

FINALLY:

Trying to be as specific as possible to describe my problem
i went through httpd.conf and php.ini as well as my.ini (for mysql ) couple times

I found in php.ini:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"

Since "./" had my apache server to fail starting,
I decided and try it out and specify the exact path too
so i changed it to "X:\pathToPHP\ext"

and TADAAAAAm it worked!
i dunno what's up with this ./ not working,
i solved it, but not sure about how or why exactly.

phpInfo() shows the correct environment variable path,
why woudlnt it look there if it doesnt find it where i specify or if ./ doesnt not exist ( if it cant understand the meaning of it)

anyway, i hope it can help someone...
and also that someone understand the exact cause of it
and explain it to me :)

eelixduppy

4:28 am on May 13, 2006 (gmt 0)



Welcome to WebmasterWorld!

By using "./", you basically said that the modules reside in C: and not in C:\PHP or whatever you have it named. So the error was just in your location. "X:\pathToPHP\ext" is not the same as "./" in this case.

eelix