|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Greetings. I am new to PHP and would appreciate any I can get.
I am having a tough time figuring out what is going on with the PHP installtion on a W2k server. I have configured PHP (by editing the php.ini file) to load the php_mysql.dll, which seems to be loaded properly because I can run "php -i" from the command prompt and see a section with mysql info as follows: ----------------------------------------------------------------------------------------------- mysql MySQL Support => enabled Active Persistent Links => 0 Active Links => 0 Client API version => 5.0.51a 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 ----------------------------------------------------------------------------------------------- PHP also seems to be working fine with IIS because I am able to display a .php page on the server that contains the command phpinfo(). However, if I run any mysql statement in the .php file, (e.g., mysql_connect), the processing seems to just stop at the mysql statement, and ignoring everything below it. No error message is returned. When I looked at the info generated from phpinfo() on the web page, I noticed two things: 1. There is no MySQL section (in contrast to the command line result above) 2. There is a ISAPI section which is not present in the command line result. I guess teh ISAPI thing is normal, but it is the lack of the MySQL section that baffles me. I have also tried usinig php_mysqli.dll instead of php_mysql.dll, and I got similar results as above. So, the problem is that the dll is not loaded by the web server (i.e., IIS). Any idea what is going on? Please . Many thanks. Patrick |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
patrick@computerbrokers.com.sg wrote:
> Greetings. I am new to PHP and would appreciate any I can get. > > I am having a tough time figuring out what is going on with the PHP > installtion on a W2k server. I have configured PHP (by editing the > php.ini file) to load the php_mysql.dll, which seems to be loaded > properly because I can run "php -i" from the command prompt and see a > section with mysql info as follows: > > ----------------------------------------------------------------------------------------------- > mysql > > MySQL Support => enabled > Active Persistent Links => 0 > Active Links => 0 > Client API version => 5.0.51a > > 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 > ----------------------------------------------------------------------------------------------- > > PHP also seems to be working fine with IIS because I am able to > display a .php page on the server that contains the command phpinfo(). > However, if I run any mysql statement in the .php file, (e.g., > mysql_connect), the processing seems to just stop at the mysql > statement, and ignoring everything below it. No error message is > returned. When I looked at the info generated from phpinfo() on the > web page, I noticed two things: > 1. There is no MySQL section (in contrast to the command line result > above) > 2. There is a ISAPI section which is not present in the command line > result. > > I guess teh ISAPI thing is normal, but it is the lack of the MySQL > section that baffles me. > > I have also tried usinig php_mysqli.dll instead of php_mysql.dll, and > I got similar results as above. So, the problem is that the dll is not > loaded by the web server (i.e., IIS). Any idea what is going on? > Please . > > Many thanks. > > Patrick > What is the configuration file you're using, as indicated by phpinfo()? Probably not the one you edited. Also, enable and display all errors - you should ALWAYS do this in a development system. That would have shown you the error, probably a missing function. In your php.ini (the correct one) you need: error_reporting = E_ALL (or E_ALL | E_STRICT) display_errors = on -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi Jerry,
I have verified that the php.ini file loaded is the one I edited. Both "php -i" and phpinfo() show that the file loaded is "c:\winnt \php.ini". Anyway, I edited php.ini as you said, and now I got an error message that says the mysql_connect function is undefined. So, it confirmed my suspecion that php_mysql.dll is not loaded/recognized by IIS. It is just strange that "php -i" says it is loaded, but phpinfo() says it is not. Any other suggestion? Thanks. Patrick |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"patrick@computerbrokers.com.sg" wrote:
> I have verified that the php.ini file loaded is the one I edited. Both > "php -i" and phpinfo() show that the file loaded is "c:\winnt > \php.ini". Anyway, I edited php.ini as you said, and now I got an > error message that says the mysql_connect function is undefined. So, > it confirmed my suspecion that php_mysql.dll is not loaded/recognized > by IIS. It is just strange that "php -i" says it is loaded, but > phpinfo() says it is not. Any other suggestion? Thanks. Do you have an up to date libmysql.dll in your system path? Because php_mysql.dll and php_mysqli.dll don't work without that. If you did a full installation of the MySQL server in the deafult path you will find that library in C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\. Either add that directory to your path or copy the dll to C:\windows\system32\ or whatever the standard dll path is on your Windows version. Bye! |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
patrick@computerbrokers.com.sg wrote:
> Hi Jerry, > > I have verified that the php.ini file loaded is the one I edited. Both > "php -i" and phpinfo() show that the file loaded is "c:\winnt > \php.ini". Anyway, I edited php.ini as you said, and now I got an > error message that says the mysql_connect function is undefined. So, > it confirmed my suspecion that php_mysql.dll is not loaded/recognized > by IIS. It is just strange that "php -i" says it is loaded, but > phpinfo() says it is not. Any other suggestion? Thanks. > > Patrick > In addition to what Anonymous said, did you stop and restart IIS? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Have repalaced the libmysql.dll in system32 as suggested and restarted
the server. Still no luck. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
patrick@computerbrokers.com.sg wrote:
> Have repalaced the libmysql.dll in system32 as suggested and restarted > the server. Still no luck. > Is it in a directory that's in your PATH, and is it readable by the IIS user (usually IUSR_(machine_name)? Do you have multiple copies of the libmysql.dll on your system? If your php.ini file is correct and is requesting the mysql extension be loaded, about the only thing left is the client dll being incorrect. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
There are multiple copies of libmysql.dll in various subdirectories of
MySQL. I moved the copy suggested by Anonymous to c:/windows/system32. C:/windows/system32 is also in the PATH. How can I verify that the IUSR_(machine_name) is able to read the PATH/ file? Patrick |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
"patrick@computerbrokers.com.sg" wrote:
> > There are multiple copies of libmysql.dll in various subdirectories of > MySQL. I moved the copy suggested by Anonymous to c:/windows/system32. > C:/windows/system32 is also in the PATH. As Jerry already said, multiple copies are never good. Depending on your path a different version might be loaded than you think. Make sure the one in system32 is the up to date one and delete all the others on your system. > How can I verify that the IUSR_(machine_name) is able to read the PATH/ > file? I'm pretty sure every user on a standard system configuration has at least read and execute permissions on the system32 directory, otherwise it would be impossible for applications to read system dlls. :-) But if you want to check to make sure just right click on the directory, select 'Sharing and Security' and click on the Security tab. At least that's the way it works on XP Pro. Bye! |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
patrick@computerbrokers.com.sg wrote:
> There are multiple copies of libmysql.dll in various subdirectories of > MySQL. I moved the copy suggested by Anonymous to c:/windows/system32. > C:/windows/system32 is also in the PATH. > > How can I verify that the IUSR_(machine_name) is able to read the PATH/ > file? > > Patrick > First of all, get rid of all of the other copies. You should only have once copy; having more will just cause more problems. Try a Windows newsgroup to check your security settings. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
Anonymous wrote:
> "patrick@computerbrokers.com.sg" wrote: >> There are multiple copies of libmysql.dll in various subdirectories of >> MySQL. I moved the copy suggested by Anonymous to c:/windows/system32. >> C:/windows/system32 is also in the PATH. > > As Jerry already said, multiple copies are never good. Depending on your > path a different version might be loaded than you think. Make sure the > one in system32 is the up to date one and delete all the others on your > system. > >> How can I verify that the IUSR_(machine_name) is able to read the PATH/ >> file? > > I'm pretty sure every user on a standard system configuration has at > least read and execute permissions on the system32 directory, otherwise > it would be impossible for applications to read system dlls. :-) > > But if you want to check to make sure just right click on the directory, > select 'Sharing and Security' and click on the Security tab. At least > that's the way it works on XP Pro. > > Bye! > They have them on the directory, but not necessarily on the files, which is why I suggested he go to a Windows newsgroup. There are slight differences between versions of Windows. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
I am still getting nowhere. I think I will try removing and
reinstalling PHP and php_mysql. |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
Reinstalling did the trick. The first time I did a manual install.
This time I used the php installer. It was so much easier! The only additional thing I had to do was to add "extension=php_mysql.dll" in php.ini. Thanks for all your anyways. Regards, Patrick On Mar 31, 11:44am, "patr...@computerbrokers.com.sg" <patr...@computerbrokers.com.sg> wrote: > I am still getting nowhere. I think I will try removing and > reinstalling PHP and php_mysql. |
|
![]() |
| Outils de la discussion | |
|
|