Link to home
Start Free TrialLog in
Avatar of Fahdmurtaza
FahdmurtazaFlag for Pakistan

asked on

Urgent.. PHP MySQL problem

Hi Experts

I am new to php and MySQL. I have installed the windows version of PHP (4.3.6 version) and I have run the php info file for you to give me suggestionss how to solve the issue that follows.

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////


Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in D:\Inetpub\wwwroot\project1\db.php on line 4

Warning: mysql_select_db(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\Inetpub\wwwroot\project1\db.php on line 5

Warning: mysql_select_db(): A link to the server could not be established in D:\Inetpub\wwwroot\project1\db.php on line 5

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////

This is what I have got after running the phpinfo file



////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////

PHP Version 4.3.6

System  Windows NT FAHD 5.1 build 2600  
Build Date  Apr 14 2004 17:17:11  
Server API  CGI/FastCGI  
Virtual Directory Support  enabled  
Configuration File (php.ini) Path  D:\WINDOWS\php.ini  
PHP API  20020918  
PHP Extension  20020429  
Zend Extension  20021010  
Debug Build  no  
Thread Safety  enabled  
Registered PHP Streams  php, http, ftp, compress.zlib  

 This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies  


--------------------------------------------------------------------------------

PHP Credits

--------------------------------------------------------------------------------

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2047 2047
expose_php On On
extension_dir ./ ./
file_uploads On On
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .;c:\php4\pear .;c:\php4\pear
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 30 30
max_input_time 60 60
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 8M 8M
precision 12 12
register_argc_argv On On
register_globals Off Off
report_memleaks On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from me@localhost.com me@localhost.com
sendmail_path no value no value
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 2M 2M
upload_tmp_dir C:\PHP\uploadtemp C:\PHP\uploadtemp
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On


bcmath
BCMath support  enabled  


calendar
Calendar support  enabled  


com
Directive Local Value Master Value
com.allow_dcom Off Off
com.autoregister_casesensitive On On
com.autoregister_typelib Off Off
com.autoregister_verbose Off Off
com.typelib_file no value no value


ctype
ctype functions  enabled  


ftp
FTP support  enabled  


mysql
MySQL Support enabled
Active Persistent Links  0  
Active Links  0  
Client API version  3.23.49  

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off


odbc
ODBC Support enabled
Active Persistent Links  0  
Active Links  0  
ODBC library  Win32  

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited


overload
User-Space Object Overloading Support  enabled  


pcre
PCRE (Perl Compatible Regular Expressions) Support  enabled  
PCRE Library Version  4.5 01-December-2003  


session
Session Support  enabled  
Registered save handlers  files user  

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path C:\PHP\sessiondata C:\PHP\sessiondata
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off


standard
Regex Library  Bundled library enabled  
Dynamic Library Support  enabled  
Internal Sendmail Support for Windows  enabled  

Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent no value no value


tokenizer
Tokenizer Support  enabled  


wddx
WDDX Support enabled
WDDX Session Serializer  enabled  


xml
XML Support  active  
XML Namespace Support  active  
EXPAT Version  1.95.6  


zlib
ZLib Support  enabled  
Compiled Version  1.1.4  
Linked Version  1.1.4  

Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value


Additional Modules
Module Name


Environment
Variable Value
ALLUSERSPROFILE  D:\Documents and Settings\All Users  
CommonProgramFiles  D:\Program Files\Common Files  
COMPUTERNAME  FAHD  
ComSpec  D:\WINDOWS\system32\cmd.exe  
CONTENT_LENGTH  0  
FP_NO_HOST_CHECK  NO  
GATEWAY_INTERFACE  CGI/1.1  
HTTP_ACCEPT  */*  
HTTP_ACCEPT_LANGUAGE  en-us  
HTTP_CONNECTION  Keep-Alive  
HTTP_HOST  localhost  
HTTP_USER_AGENT  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)  
HTTP_ACCEPT_ENCODING  gzip, deflate  
HTTPS  off  
INSTANCE_ID  1  
LOCAL_ADDR  127.0.0.1  
NUMBER_OF_PROCESSORS  1  
OS  Windows_NT  
Path  D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem  
PATH_INFO  /CCleaguePro_V1.0.0/setup/phpinfo.php  
PATH_TRANSLATED  d:\inetpub\wwwroot\CCleaguePro_V1.0.0\setup\phpinfo.php  
PATHEXT  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH  
PROCESSOR_ARCHITECTURE  x86  
PROCESSOR_IDENTIFIER  x86 Family 15 Model 1 Stepping 2, GenuineIntel  
PROCESSOR_LEVEL  15  
PROCESSOR_REVISION  0102  
ProgramFiles  D:\Program Files  
REMOTE_ADDR  127.0.0.1  
REMOTE_HOST  127.0.0.1  
REQUEST_METHOD  GET  
SCRIPT_NAME  /CCleaguePro_V1.0.0/setup/phpinfo.php  
SERVER_NAME  localhost  
SERVER_PORT  80  
SERVER_PORT_SECURE  0  
SERVER_PROTOCOL  HTTP/1.1  
SERVER_SOFTWARE  Microsoft-IIS/5.1  
SystemDrive  D:  
SystemRoot  D:\WINDOWS  
TEMP  D:\WINDOWS\TEMP  
TMP  D:\WINDOWS\TEMP  
USERPROFILE  D:\Documents and Settings\LocalService  
windir  D:\WINDOWS  


PHP Variables
Variable Value
_SERVER["ALLUSERSPROFILE"] D:\\Documents and Settings\\All Users
_SERVER["CommonProgramFiles"] D:\\Program Files\\Common Files
_SERVER["COMPUTERNAME"] FAHD
_SERVER["ComSpec"] D:\\WINDOWS\\system32\\cmd.exe
_SERVER["CONTENT_LENGTH"] 0
_SERVER["FP_NO_HOST_CHECK"] NO
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["HTTP_ACCEPT"] */*
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_HOST"] localhost
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTPS"] off
_SERVER["INSTANCE_ID"] 1
_SERVER["LOCAL_ADDR"] 127.0.0.1
_SERVER["NUMBER_OF_PROCESSORS"] 1
_SERVER["OS"] Windows_NT
_SERVER["Path"] D:\\WINDOWS\\system32;D:\\WINDOWS;D:\\WINDOWS\\System32\\Wbem
_SERVER["PATH_INFO"] /CCleaguePro_V1.0.0/setup/phpinfo.php
_SERVER["PATH_TRANSLATED"] d:\\inetpub\\wwwroot\\CCleaguePro_V1.0.0\\setup\\phpinfo.php
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_SERVER["PROCESSOR_ARCHITECTURE"] x86
_SERVER["PROCESSOR_IDENTIFIER"] x86 Family 15 Model 1 Stepping 2, GenuineIntel
_SERVER["PROCESSOR_LEVEL"] 15
_SERVER["PROCESSOR_REVISION"] 0102
_SERVER["ProgramFiles"] D:\\Program Files
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["REMOTE_HOST"] 127.0.0.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["SCRIPT_NAME"] /CCleaguePro_V1.0.0/setup/phpinfo.php
_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_PORT_SECURE"] 0
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["SERVER_SOFTWARE"] Microsoft-IIS/5.1
_SERVER["SystemDrive"] D:
_SERVER["SystemRoot"] D:\\WINDOWS
_SERVER["TEMP"] D:\\WINDOWS\\TEMP
_SERVER["TMP"] D:\\WINDOWS\\TEMP
_SERVER["USERPROFILE"] D:\\Documents and Settings\\LocalService
_SERVER["windir"] D:\\WINDOWS
_SERVER["PHP_SELF"] /CCleaguePro_V1.0.0/setup/phpinfo.php
_SERVER["argv"] Array
(
)
 
_SERVER["argc"] 0
_ENV["ALLUSERSPROFILE"] D:\\Documents and Settings\\All Users
_ENV["CommonProgramFiles"] D:\\Program Files\\Common Files
_ENV["COMPUTERNAME"] FAHD
_ENV["ComSpec"] D:\\WINDOWS\\system32\\cmd.exe
_ENV["CONTENT_LENGTH"] 0
_ENV["FP_NO_HOST_CHECK"] NO
_ENV["GATEWAY_INTERFACE"] CGI/1.1
_ENV["HTTP_ACCEPT"] */*
_ENV["HTTP_ACCEPT_LANGUAGE"] en-us
_ENV["HTTP_CONNECTION"] Keep-Alive
_ENV["HTTP_HOST"] localhost
_ENV["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
_ENV["HTTP_ACCEPT_ENCODING"] gzip, deflate
_ENV["HTTPS"] off
_ENV["INSTANCE_ID"] 1
_ENV["LOCAL_ADDR"] 127.0.0.1
_ENV["NUMBER_OF_PROCESSORS"] 1
_ENV["OS"] Windows_NT
_ENV["Path"] D:\\WINDOWS\\system32;D:\\WINDOWS;D:\\WINDOWS\\System32\\Wbem
_ENV["PATH_INFO"] /CCleaguePro_V1.0.0/setup/phpinfo.php
_ENV["PATH_TRANSLATED"] d:\\inetpub\\wwwroot\\CCleaguePro_V1.0.0\\setup\\phpinfo.php
_ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_ENV["PROCESSOR_ARCHITECTURE"] x86
_ENV["PROCESSOR_IDENTIFIER"] x86 Family 15 Model 1 Stepping 2, GenuineIntel
_ENV["PROCESSOR_LEVEL"] 15
_ENV["PROCESSOR_REVISION"] 0102
_ENV["ProgramFiles"] D:\\Program Files
_ENV["REMOTE_ADDR"] 127.0.0.1
_ENV["REMOTE_HOST"] 127.0.0.1
_ENV["REQUEST_METHOD"] GET
_ENV["SCRIPT_NAME"] /CCleaguePro_V1.0.0/setup/phpinfo.php
_ENV["SERVER_NAME"] localhost
_ENV["SERVER_PORT"] 80
_ENV["SERVER_PORT_SECURE"] 0
_ENV["SERVER_PROTOCOL"] HTTP/1.1
_ENV["SERVER_SOFTWARE"] Microsoft-IIS/5.1
_ENV["SystemDrive"] D:
_ENV["SystemRoot"] D:\\WINDOWS
_ENV["TEMP"] D:\\WINDOWS\\TEMP
_ENV["TMP"] D:\\WINDOWS\\TEMP
_ENV["USERPROFILE"] D:\\Documents and Settings\\LocalService
_ENV["windir"] D:\\WINDOWS


PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
 

////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////


Please help me with this problem. I have checked that MySQL is working fine.May be the reason is the version of PHP or MySQL I am using.

Suggest me whatever you think would be useful.

Regards,
Fahd Murtaza
Avatar of akshah123
akshah123
Flag of United States of America image

well what version of mysql server are you running?
Avatar of Fahdmurtaza

ASKER

Thanks  akshah123

I am using MySQL Server 4.1

Regards,
Fahd Murtaza
mysql> SET PASSWORD FOR
    -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');


To change your password to the old_password format.  For more info check out:

http://dev.mysql.com/doc/mysql/en/old-client.html

ok
Squeebee

I deleted all the users from the users I see in the MySQL control center. I am not able anymore to connect with the my sql server from localhost. Please help on correcting this. MySQL thing still turns up to be under developement till now, as there occur alot of difficult to solve issues.

Regards,
Fahd Murtaza
Nobody told you to delete all your users. Did you even delete the root user?

MySQL and PHP will always be under development, projects like these always have new work to do.
Hi Squeebee

Nobody told me to do so but I did teh mistake. Yeah I deleted the root as well. What to do.I have now no sql server setup. MySQL Server Instance Config Wizard doesn't also help.I tried to remove the instances but it didn't work and it didn't applied the security settings and told the reason for this is that localhost can't connect to mysql server.

Regards,
Fahd Murtaza
SOLUTION
Avatar of Squeebee
Squeebee
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wait hold on... You might not need to reinstall if that reinstalling is going to create additional problems for you...

Check out...http://dev.mysql.com/doc/mysql/en/resetting-permissions.html

This allowes you to reset the root password.  In your case it is a little different since you deleted the root account but try putting in

GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mypass';
Thanks..I am going to try both the suggestions.

Regards,
Fahd Murtaza
Ok I think I solved the above issue. I am not using any password for root now as it was not implementing the security policies for localhost when I chose a password for root.Anyway I left that.

Now I have also checked manual files of php, they work fine with my iis. Also MySQL Is working. When I try to use a free source software (thats why I am confident its coding doesn't have any problem with coding as its working fine our own web servers), there comes this follwing error.

Fatal error: Call to undefined function mysql_connect() in D:\Inetpub\wwwroot\CCleaguePro_V1.0.0\index.php on line 24

Yes I know that php may not be configured properly to work with mysql on windows but I want a solution to this issue.I am left with very less time for my work as I have also to attend the school from tomorrow, so please help.

Regards,
Fahd Murtaza
You need to enable the mysql.dll.

Go to your php.ini file and uncomment

 to enable mysql extension,

go to your php.ini file and uncomment

;extension=php_mysql.dll

this extension should be uncommented
then copy libmysql.dll from your PHP directory (usually C:\php on a windows system) to your system direct (C:\WINNT\system32 )
restart and Check the output of phpinfo().
Under Configuration, you should see a table labeled "mysql"



alternatively you could also have a following problem, check out....

https://www.zend.com/phorum/read.php?num=7&id=3779&thread=3778
I am trying to solve it. I tried your suggestions but simply doing that doesn't solve it. I have mysql installed as you know. I have copied the libmysql.dll to the d:/windows/system32/ which is for my winxp.I have installed PHP on C:/php and my php.ini resides in d:/windows/. I have tried to change the extension sdirectory this way

extension_dir = "D:\WINDOWS\system32\"

but after commenting it produced follwing error

Fatal error: Call to undefined function mysql_connect() in D:\Inetpub\wwwroot\CCleaguePro_V1.0.0\index.php on line 24
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\WINDOWS\system32\php_mysql.dll' - The specified module could not be found. in Unknown on line 0

Also I have tried this way

extension_dir = "D:\WINDOWS\system32\php_mysql.dll"

Fatal error: Call to undefined function mysql_connect() in D:\Inetpub\wwwroot\CCleaguePro_V1.0.0\index.php on line 24

But I dont think this even works. I mean I have just checked it and it produced above errorr.

I am getting totally stuck.

Dont know what to do now. I have been reading faq's searching ee,google. But nothing seems to help.

Regards,
Fahd Murtaza

well,

extension_dir = "D:\WINDOWS\system32\"

is wrong.

Extension dir calls for the extensions of php.  Those should be inside php installation folder.

c:\php

THere should be a folder for all the extensions. Should be called "ext".  It might be under a subdirectory of php also.  That should be your extension dir.

You will need to change the extension_dir setting to point to the directory where your extensions lives, or where you have placed your php_*.dll files. For example:

extension_dir = C:\php\extensions
There are only three folders in

c:/php namely BACKUP, sessiondata , uploadtemp. Please note I am using auto installer for php 5.

Regards,
Fahd Murtaza
Oh I placed my files in

d:/windows/system32/

Regards,
Fahd Murtaza

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK I installed the php 4.3 with an installer and its working fine now.I am though having some php errors in the application pages. Though the mysql_connect() fatal error is gone.

Regards,
Fahd Murtaza