tags:

views:

221

answers:

3

hi, I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().

  1. I modified php.ini to have extension_dir = "c:\php\ext"
  2. modified the extension as extension="php_mysql.dll"
  3. added "c:\php" to the "PATH" environment variable and restarted the vista.

after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!

I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...

Any help will be appreciated. Thanks in advance.

+1  A: 

You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.

You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"

dododedodonl
Hi dodo... , thanx for your time. I had done both changes what u suggested but still no effect on phpinfo(). can u advice me the correct places to put php.ini and libmysql.dll files if they are other that c:/php and c:/windows/system32 respectively. I dont see any other concern to deal with
MB
A: 

put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])

Dan Beam
hi Dan, thanx for the suggestion but I am with the mentioed changes. any other changes which should be there?
MB
A: 
VolkerK
hi VolkerK, thanx for your valuable opinion. I am getting nothng (blank page)on running the code <?php echo get_cfg_var('cfg_file_path'); which kind of additional dependency r u takhing about? Yes, I am using php 5.3.1 from php.net and I do have mysqlnd module present on phpinfo(). I am posting this question because I am getting the Fatal error: Call to undefined function mysql_connect() after executing the code related to mysql_connect() on my php build 5.3.1.looking for your suggestions and thanx for your time
MB
Please try the "enhanced" info script (added ini="..." to the output to make sure "something" is always printed, a blank page could also mean "parse error", therefore it's better to always print "something"). If it still prints an empty value for cfg_file_path then this php instance didn't use/find any php.ini at all. see http://docs.php.net/configuration.file (The additional dependency would have been libmysql.dll but since you're using mysqlnd this doesn't apply)
VolkerK
THANX VolkerK for showing me correct way to fix the issue :)after executing the code correctly, I saw the empty path as ini="" . The issue was in the filename! I corrected my 'php.ini' file with correct file name(initially it was php.ini.ini) ;) Now my phpinfo() is showing mysql too. (Now no more Fatal error: Call to undefined function mysql_connect() ) Thankyou :)
MB