Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2004, 08:51 AM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Installation issues

I have Apache up and running on my Windows XP and http://localhost is recognising Apache as being there.

I also have my phpinfo.php file in the c:/apache/htdocs directory.

However, when I run http://localhost/phpinfo.php all I get is a "The page cannot be found" message...


Can any spread some light here?

 
Old January 30th, 2004, 04:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How did you write your phpinfo.php file? If you used notepad, I'd double check to make sure that notepad didn't append a .txt extension to the file.


Take care,

Nik
http://www.bigaction.org/
 
Old January 30th, 2004, 09:08 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I madem sure it didn't...in the nd I use easyphp and tings are now running well enough...but what a ridiculous install session?!?!?!? I mean seriously, it' 2004 and this is not an uncommon issue. Does any other software have such a stupid instal period?

 
Old January 30th, 2004, 10:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To be honest, I've never had a problem installing PHP independently of Apache. I have multiple versions of PHP downloaded on my machine, and can pretty easily tell Apache to switch between various versions and modes (Apache module vs CGI) for these without any headaches.

Maybe something just got screwed up somewhere.


Take care,

Nik
http://www.bigaction.org/
 
Old February 3rd, 2004, 07:32 PM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem. You need to edit the httpd.conf file that comes with Apache. There should be info on this at www.php.net. If i remember correctly, you have to add 3 lines to read the file correctly.

 
Old February 3rd, 2004, 08:00 PM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there any way to edit previous replies? This pretty weak.

I did the exact same thing. I tried installing Apache and PHP on my XP and ended up deleting it, installing easyPHP. LOL.

1.) Setup apache first, test it, make u get localhost page to display
2.) Setup PHP

Look for a file httpd.conf
Here's the directory i found it in (C:\program files\apache group\apache\conf)

Inside httpd.conf, look for this block (about line 510-520)
Code:
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
Insert these two lines right after seeing that ScriptAlias
Code:
ScriptAlias /php/ "C:/php/"
Action application/x-httpd-php "/php/php.exe"
I also added this line to my AddHandler (about Line 770)
Code:
AddType application/x-httpd-php .php
 
Old February 4th, 2004, 01:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's actually a pretty horrible way to install PHP on apache, because you introduce a lot of security risks by running PHP as a CGI instead of an apache module.
  http://www.php.net/security.cgi_bin


To load PHP as an apache module on windows, make sure these lines exist in your httpd.conf:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php


Each of the above lines should be located in the appropriate location in httpd.conf -- that is, put each line next to other lines that look a heck of a lot like it.

Also, make sure your paths are correct.


Take care,

Nik
http://www.bigaction.org/
 
Old February 4th, 2004, 06:48 PM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by nikolai
 That's actually a pretty horrible way to install PHP on apache, because you introduce a lot of security risks by running PHP as a CGI instead of an apache module.
  http://www.php.net/security.cgi_bin


To load PHP as an apache module on windows, make sure these lines exist in your httpd.conf:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php


Each of the above lines should be located in the appropriate location in httpd.conf -- that is, put each line next to other lines that look a heck of a lot like it.

Also, make sure your paths are correct.


Take care,

Nik
http://www.bigaction.org/
OK. I had no clue about that. The book I have said nothing about it being a security issue and didn't provide another way of setting it up.

Thanks

 
Old February 4th, 2004, 09:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah, I didn't have any clue about it originally either. I think at the time the book was being published, most people that knew anything about PHP (and were willing to take the time to write a book about it) were also clueless of the issues.

I mean, take a look at all the register_globals problems everyone's having. Once upon a time, it was considered clever and elegant to have variables of the same name come from multiple sources. Now it's considered taboo and a potential can o' worms...


Take care,

Nik
http://www.bigaction.org/
 
Old February 5th, 2004, 01:33 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Also, don't forget to move the 'php4ts.dll' to the system32 file in the windows folder. That part of it held me up for about an hour or two! I guess some webservers require that file and some don't, PHP as a Apache Module definitely does.

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 - PHP installation issues Abelmiah BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 21st, 2009 05:01 PM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
Yet More Installation Issues matthewfoley BOOK: ASP.NET Website Programming Problem-Design-Solution 5 November 18th, 2003 06:09 AM
PHP installation issues, yet again donh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 September 22nd, 2003 07:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.