PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Need with PHP + MySQL on W2k
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Need with PHP + MySQL on W2k

Réponse
 
LinkBack Outils de la discussion
Vieux 28/03/2008, 11h21   #1
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Need with PHP + MySQL on W2k

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
  Réponse avec citation
Vieux 28/03/2008, 13h21   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
==================

  Réponse avec citation
Vieux 28/03/2008, 13h27   #3
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
  Réponse avec citation
Vieux 28/03/2008, 13h37   #4
Anonymous
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

"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!
  Réponse avec citation
Vieux 28/03/2008, 18h35   #5
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
==================

  Réponse avec citation
Vieux 29/03/2008, 04h22   #6
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

Have repalaced the libmysql.dll in system32 as suggested and restarted
the server. Still no luck.
  Réponse avec citation
Vieux 29/03/2008, 05h29   #7
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
==================

  Réponse avec citation
Vieux 29/03/2008, 07h38   #8
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
  Réponse avec citation
Vieux 29/03/2008, 15h05   #9
Anonymous
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

"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!
  Réponse avec citation
Vieux 29/03/2008, 15h07   #10
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
==================

  Réponse avec citation
Vieux 29/03/2008, 16h09   #11
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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
==================

  Réponse avec citation
Vieux 31/03/2008, 04h44   #12
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

I am still getting nowhere. I think I will try removing and
reinstalling PHP and php_mysql.
  Réponse avec citation
Vieux 01/04/2008, 15h56   #13
patrick@computerbrokers.com.sg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with PHP + MySQL on W2k

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.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h15.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20776 seconds with 21 queries