Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL doesn't work with PHP in Apache on Windows

Status
Not open for further replies.

Czollli

Programmer
Feb 29, 2004
9
HU
Hi All,

Result of command line execution :


C:\Program Files\Apache Group\Apache2\proxy>php
<?print_r(get_loaded_extensions());?>
^Z
Array
(
[0] => bcmath
[1] => calendar
[2] => com_dotnet
[3] => ctype
[4] => ftp
[5] => iconv
[6] => odbc
[7] => pcre
[8] => session
[9] => SPL
[10] => SQLite
[11] => standard
[12] => tokenizer
[13] => zlib
[14] => libxml
[15] => dom
[16] => SimpleXML
[17] => wddx
[18] => xml
[19] => bz2
[20] => mysql
[21] => mysqli
)


Result of web execution :


<?php
print_r(get_loaded_extensions());
?>
Array ( [0] => bcmath [1] => calendar [2] => com_dotnet [3] => ctype [4] => ftp [5] => iconv [6] => odbc [7] => pcre [8] => session [9] => SPL [10] => SQLite [11] => standard [12] => tokenizer [13] => zlib [14] => libxml [15] => dom [16] => SimpleXML [17] => wddx [18] => xml [19] => apache2handler )


Does anybody know where is the two sql extension ??? :((

My enviroment is :
Windows XP,
Apache 2.0.5,
PHP 5.0.1,
MySQL 5.0.0a.

Thanks a lot !
Czollli
 
Hi,

I have found the solution in the meantime !!!

Copy the php.ini in Windows (or Winnt) directory !

Czollli
 
Glad you figured it out... there's also a faq about it in the faq section which gives a little more detail.

faq434-5246
 
This FAQ did NOT solve my problem !
Read my solution more carefully ! :)

I have found a huge amount of such an advice (I have tried it without any success) but I had NO problems at startup, I had NO error messages, I couldn't really debug it :(( ONLY I couldn't see the mysql extension in the browser but I saw in the command line.

I don't really understand because the path of php.ini was in the PATH enviroment variable.
 
Yeah I caught that after I made my post. Sorry about that.

Going from the documentation the path is not good enough.

Your options were
1) PHPIniDir directive (Apache 2 module only)
2) HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath
3) The PHPRC environment variable
4) Directory of PHP (for CLI), or the web server's directory (for SAPI modules)
5) Windows directory (C:\windows or C:\winnt)


Though I'm pretty certain I've have problems with #4 in the past.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top