News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[Unknown]'s Guide to Installing PHP and MySQL.

Started by [Unknown], November 16, 2003, 03:40:49 PM

Previous topic - Next topic

Curbow 5

A note on configuring PHP - Apache from php.net:

If you would like to use PHP as a module in Apache, be sure to copy php4ts.dll to the windows/system  (for Windows 9x/Me), winnt/system32 (for Windows NT/2000) or windows/system32 (for Windows XP) directory, overwriting any older file.

[Unknown]

Quote from: Curbow 5 on November 27, 2003, 02:01:15 PM
A note on configuring PHP - Apache from php.net:

If you would like to use PHP as a module in Apache, be sure to copy php4ts.dll to the windows/system  (for Windows 9x/Me), winnt/system32 (for Windows NT/2000) or windows/system32 (for Windows XP) directory, overwriting any older file.

Oops, totally forgot that step.  Actually, you can copy it into the PHP directory in the sapi directory, which is what I've always done.  Sorry, I did it instinctively... I'll add it to the guide.

Thanks.

-[Unknown]

Ardenn

#22
I followed this manually with IIS on Windows 2000 Pro, PHP, and MySQL.  Everything was done step by step.  I rebooted, then placed the phpinfo script in the wwwroot directory and attempt to browse to it.  http://localhost/phpinfo.php and it says, PAGE CANNOT BE DISPLAYED.  I have verified the PHP file is indeed in the wwwroot directory.  I just can not access it.. Any suggestions?

I goto localhost and I get the IIS screen so I know the webserver is indeed running.

FIXXED: The reason why is because I was not using PHP as the script executable.
Ardenn // Traxxus
http://www.twinwand.com
D&D Play by Post Community Looking for Players and DM's

zeppsstteerr

#23
Hi Unknown or anyone else who might be able to help.  I followed this tutorial word for word but am having troubles.  I got Apache installed and it tested fine. Got MySQL installed and PHP.  Rebooted and tried to test with the phpinfo file and I get "page cannot be displayed error" .  In addition if I type in hxxp:localhost/ [nonactive]  i get nothing now where as before I got the Apache welcome stuff.  Im using WinXP Pro, Apache 1.3.29, PHP 4.3.4, etc..  can someone help get me going.  Please!!!

EDIT:  ok, when trying to start Apache using the .exe found in the Apache directory I get an error saying it cannot add the module:  mod_php4.c

Here's what my httpd.conf looks like:

#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule php4_module C:/Program Files/PHP/sapi/php4apache.dll
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule status_module modules/mod_status.so
#LoadModule info_module modules/mod_info.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so

#
#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#
# The modules listed below, without a corresponding LoadModule directive,
# are static bound into the standard Apache binary distribution for Windows.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!]
ClearModuleList
#AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
#AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_isapi.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
#AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_auth_digest.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php4.c

[Unknown]

Did you forget to add LoadModule?

(LoadModule php4_module "C:/Program Files/PHP/sapi/php4apache.dll" should be near that block of LoadModules.)

-[Unknown]

zeppsstteerr

I did that...  I highlighted it for you to see.  Any other suggestions?

Thanks

Jeff

zeppsstteerr

Thanks [Unknown], although i had the LoadModule command in there for some reason I had the # sign in front like the others so it wasn't executing.  Got it now and it works!! :D

remura

Hi, [Unknown]!
this is  my first post here and also my first step learning php. I came after i read u'r post @ hxxp:www.emuforums.com [nonactive]. Hope i'll be accepted here  :)

Okay, i had this problem after installing IIS and PHP. I only get HTTP 500 internal server error when opening php files. In second check i seems that i misread u'r guide and do the steps for PWS ( merging the reg files), and i don't know how to fix it. How?

thx in advance

[Unknown]

Hmmm... this might not be good... well...

Try just doing the steps for IIS.... and, if that doesn't work, I'll tell you what to remove with RegEdit... (fun... :/)

Of course you'll be accepted here!

-[Unknown]

remura

err... i've already continuing with the IIS step, but it's still th same 500 error  :(

[Unknown]

Hmm... well, try opening RegEdit... (Start -> Run -> type "regedit") browsing to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map

... and, deleting anything in there. (like ".php")

If that doesn't solve the problem, please tell me what operating system you're on...

-[Unknown]

remura


[Unknown]

What happens if you try to run PHP from the command line?

Start -> Run -> type "cmd"... then type "echo. | c:\progra~1\php\php.exe"..

-[Unknown]

remura

it says:

Content-type: text/html
X-Powered-By: PHP.4.3.4

[Unknown]

Are you using ISAPI?  Try using the CGI version... that is, where you put this:

"C:\Program Files\PHP\sapi\php4isapi.dll"

Change it to:

"C:\Program Files\PHP\php.exe"

-[Unknown]

remura

#35
Now the error page changes, and shows:

Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.

EDIT: WHOOPPPSS.. after reading once more the error page and the manual page, i  think the problem is from the cgi redirect options, go check it, and RIGHT, i haven't deleted the semicolon.
{Slamming head to the nearest wall:P

i think u should add a more specific instructions to delete the semicolon [Unknown].

Okay, thx alot. U'r help is very much appreciated.
{searching for a thumb smiley, but can't find any so decided to use: ;D}

[Unknown]

#36
Quote from: remura on December 24, 2003, 08:19:36 AM
i think u should add a more specific instructions to delete the semicolon [Unknown].

Actually, I think I must've forgotten a step because ISAPI should work.....

*later*

Alright, I've added two things I forgot that will make ISAPI work better under IIS:

QuoteThis last part differs from most instructions - so I'll tell you both, and you can decide.  I suggest that you copy "php4ts.dll" from the PHP directory into the "sapi" directory, but the PHP manual says to copy it into C:\WINDOWS\system32. (system on 95, 98, and ME.)  Windows will find it in both places, so it's really your choice - I prefer not to "polute" my system32 directory.

QuoteRename it to php.ini, and copy it into the C:\WINDOWS directory.

-[Unknown]

remura

copied php4ts.dll to both sapi and windows/system32 directory, also copied php.ini to c:/windows.
reverted back to ISAPI, still don't work.

{i must admitted that i just realised that i copied the wrong files, PHP4ts.lib instead of the dll before this, but it's fixed now, no change  :( }

What so the diff between ISAPi and the CGI one, BTW?

[Unknown]

ISAPI is faster... not a huge difference, I guess.

You probably have to restart IIS.  Yuo can do this by going to Start -> Run, and typing cmd... then, typing:
net stop w3svc & net start w3svc

Then try it.

-[Unknown]

remura

i even had restarted my comp, and it's still don't fix. I guess i have to use CGI. I had a semester test for next week anyway, so i have to forget the php lesson for awhile

Advertisement: