|10:53 pm on Sep. 28, 2004 (utc 0)|
Hey everyone, I'm surfing the net looking for answers but I thoguht I should post the question somewhere so I have something to fall back on.
I am running:
Windows Xp SP2
The are all running fine from what I can tell.
I have 1 problem, I cannot connect to the mysql server using php, it's giving me the error noted in the subject line. The error says the function is undefined but I assume it is in the .dll file that the php.ini file loads(php5apache2.dll for php to work on apache and php_mysql.dll loaded as an extension for php to talk to mysql). Everything loads fine, I don't get any errors when starting up apache, the phpinfo() page works perfectly, but it juts won't talk to mysql server...
|11:03 pm on Sep. 28, 2004 (utc 0)|
|1:24 am on Sep. 29, 2004 (utc 0)|
I've done everything but
"For compiling, simply use --with-mysql=[DIR] where [DIR] points to your MySQL installation directory."
I don't know what this means :(
|7:19 am on Sep. 29, 2004 (utc 0)|
it means the directory in which mysql is located.
|12:35 pm on Sep. 29, 2004 (utc 0)|
You are running Windows so you more than likely did not compile PHP but are running PHP from a binary installation. Did you uncomment the MySQL extension yet in your php.ini file?
See step 6 in message #2 in Installing PHP5 Unders Windows XP and Apache.
|1:09 pm on Sep. 29, 2004 (utc 0)|
I know what the [DIR] means, I am saying I don't know how to compile PHP on a windows machine.
I have uncommented all the extensions I wish to use, and I am not getting any errors that apache/php can't find anything(meaning I have the .dlls in the correct spot). It just doesn't know what the mysql functions are....
Any help would be appreciated. The php installation works fine otherwise, I've used basic php functions for, time, date, info... etc. They all work great, it just doesn't know where the functions for mysql are.
*edited for spelling/grammer*
|5:38 pm on Sep. 29, 2004 (utc 0)|
let's take a step back and have a look at what's going on here.
>> I am not getting any errors that apache/php can't find anything
actually that's not true, you are getting an error that there is an undefined function, which means php can't find something.
>> I've used basic php functions
so we know that php is where it needs to be
>> I have the .dlls in the correct spot
so we know, and hopefully have checked a bunch of times ;), that the dll's are in the right spot.
So, the way I see it everything seems to be in the right spot except there seems to still be confusion. So how could everything be in the right spot yet php can't find it? First think how does php/apache find things?
>> I have uncommented all the extensions I wish to use
ok, but, something is still wrong
do you have only a single php.ini? (I have heard this problem many, many times on windows installs)
are you positive you are editing the one apache is using?
delete or rename the one you are editing and see if it still runs as is
|8:16 pm on Sep. 29, 2004 (utc 0)|
I did a complete search of my machine to find all occurences of php.ini files. I found 1 php.ini, and the php.ini_old file that I created when I was trying to debug this problem, also found the php.ini-default files or whatever the php distribution ships with.
I'm going to go back to the very beginning and clean everything up, and configure it all again using the walk through.... who cares if I figure out what's wrong, I just want the damn thing to work :P
I'll report back asap.
|8:20 pm on Sep. 29, 2004 (utc 0)|
and yes, I should correct myself. PHP and Apache aren't reporting any errors in finding the actually .dll files, I didn't mean it can't find functions(which I am assuming are in one of those .dll files it DOES find....)
|9:48 pm on Sep. 29, 2004 (utc 0)|
I don't know what's going on.
it's giving me the same freaking crap....
anyone know where the mysql_connect() function is defined in php? is it in one of those dlls and maybe it just doesn't have it in there? I'm lost.
|1:00 pm on Sep. 30, 2004 (utc 0)|
I've moved the php.ini file to the Apache2 root dir(default apache2 install) and the phpinfo() still says it's in C:\Windows, yet I've got show hidden and system files there, and it's not there. I also went into th command prompt and looked for it there(just in case it wasn't showing up in the Windows GUI) and it isn't there.
Why would phpinfo() be saying it's using the php.ini file in C:\Windows when there isn't one there? Is it because that is where I first put the file?
Note** I have restarted apache and the computer multiple times
|1:49 pm on Sep. 30, 2004 (utc 0)|
I have a setup almost exactly like yours, the main difference being I DO NOT have XP Service Pack 2 installed, and I just...
Therefore, I would venture to guess that if phpinfo() is telling you it found the php.ini file in a certain path, then it found it in that path. If you are using MS Internet Explorer for the browser, clear the cache and try again. If phpinfo() tells you that it found the file there, I'm guessing it found the file there. Try what jatar_k mentioned earlier, try renaming the only php.ini file you have to something like php.bak and stop and restart apache, and call phpinfo() again. If it works, then it is indeed finding the php.ini file somewhere else and you'll have to track it down.
|2:08 pm on Sep. 30, 2004 (utc 0)|
It runs without the php.ini file.... now how can I tell where it is?
I've went through command to look for it, it's not viewable through windows explorer...
|2:23 pm on Sep. 30, 2004 (utc 0)|
OK, I just renamed my php.ini as well and stopped and restarted Apache. There is absolutely no php.ini file on my system anywhere. Apache will start without error, and phpinfo() WILL indeed run, but searching down through the directives, I find absolutely zero reference to MYSQL, therefore the extension is not loading. The Configuration File (php.ini) Path still shows C:\WINDOWS though and I don't know why -- I would have to research this, and maybe it's a bug or perhaps it's an internal thing. Either way, it is a bit deceptive.
OK, time out. I just realized that it says C:\WINDOWS, not C:\WINDOWS\php.ini! Yes, the C:\WINDOWS directory is the last path being searched and it didn't find any php.ini file there, so this is a correct identification.
Either way, all I have to do is copy my php.ini file with my extensions uncommented back into the C:\WINDOWS directory, stop apache, start apache, and I'm back on track.
[edited by: coopster at 2:47 pm (utc) on Sep. 30, 2004]
|2:31 pm on Sep. 30, 2004 (utc 0)|
One other thing that is coming to mind as I read those pages though is that you should also make sure you don't have a php-SAPI.ini file laying around somewhere.
|2:44 pm on Sep. 30, 2004 (utc 0)|
tell me this:
put your php.ini file in your apache2 directory and restart apache, and tell me if that changes your config location to apache2 directory....(edit DOH, you already did this....)
on mine, it doesn't change the install directory, but the FAQ link you gave says it looks in apache2 directory first, then goes out to the windows directory....
Mine doesn't change(whether it actually looks in different spots I can't be certain.).
What should I try next?....
|2:50 pm on Sep. 30, 2004 (utc 0)|
Did you also make sure you don't have a php-SAPI.ini file laying around somewhere?
|2:53 pm on Sep. 30, 2004 (utc 0)|
BING, something a friend found for me....
it doesn't help the situation much, but at least I'm not alone.
It really only says that the person having the problem went the cgi instead of the module way.
maybe I should try that :( I really think the module way is what I want.
[edited by: coopster at 4:13 pm (utc) on Sep. 30, 2004]
[edit reason] fixed sidescroll [/edit]
|3:51 pm on Sep. 30, 2004 (utc 0)|
>>went the cgi instead of the module way
What do you have in Apache ( httpd.conf ) for your PHP configuration settings?
By the way, I found what I was looking for earlier...
|4:05 pm on Sep. 30, 2004 (utc 0)|
What I did....
In one of the tutorials that I read it told me to edit the PHPIniDir = "C:\PHP"
I've changed this back to "./" and it's now reading the apache directory for php.ini and loading the settings in there
Thanks for getting me on the right track.
I'm getting more errors now, but they are different, it's "seeing" the mysql functions now, now I have to configure mysql properly :)
|4:37 pm on Sep. 30, 2004 (utc 0)|
>>In one of the tutorials that I read it told me to edit the PHPIniDir = "C:\PHP"
The example in the PHP Apache 2.0.x on Microsoft Windows installation instructions is probably where you came across that directive and it's example setting. But you didn't change it to reflect the correct path to your php.ini file ;)
Glad you got it.
|1:52 pm on Oct. 1, 2004 (utc 0)|
yes, very silly mistake... the real problem though, is phpinfo() telling me it's reading the php.ini file from the C:\windows directory when infact,it was reading from the C:\php directory, not finding anything and initializing defaults....
I personally, would like to see php bomb out and say "Hey stupid, there is no php.ini file for me to read, where you said it was!"
would make troubleshooting this sort of problem alot easier :P