Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 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 May 16th, 2004, 10:02 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting PHP and Apache to work together.

Getting PHP and Apache to work together.

Hello. Is anyone else experiencing a similar problem?
I have Windows98. Whatever I try, I still can't ensure that both PHP 4.3.6 and Apache 1.3.31 have been installed together - as suggested on page 18 of the book. My Apache screen states

Apache/1.3.29 (win32) PHP/4.3.6 running…. This after following helpful advice to Ray about editing httpd.conf to not referencing the sapi subfolder

But when I try to run the test program including php commands none produce any effect in my browser window although the file loads and its source can be inspected in the browser.

I have :-
1. Copied the php dll files into my windows/system folder,
2. Copied the php4ts.dll file into my Apache bin folder, into the folder containing apache.exe, into my windows folder, and into the folder where php4apache.dll file is loaded from.
3. Renamed and edited the php.ini file in line with recommendations in the PHP installation text file, copying it into my windows folder.

I don’t know if this is relevant – my Apache screen also states

[warn] (2)No such file or directory: exec() may not be safe.

Can anyone suggest anything please?

Steve


 
Old May 17th, 2004, 04:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should check Apache's httpd.conf file to make sure you've registered .php files as PHP scripts.

You should have the following lines somewhere in there:

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



Take care,

Nik
http://www.bigaction.org/
 
Old June 1st, 2004, 10:00 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've now succeeded at last in getting PHP to work with Apache. Phew!

It seems Nik's advice worked . I used the lines he gave me rather than the 2 AddType lines listed on page 15 of the book.

The book doesn't make clear about the difference between running PHP as an Apache module as opposed to a CGI binary. I found the article How to Install and Configure PHP4 to Run with Apache on Windows
by Christopher Heng, http://www.thesitewizard.com/ very helpful.

My face went red when I found I had also made two other mistakes which are very basic:
1) downloading the wrong Apache installation file instead of apache_1.3.31-win32-x86-no_src.msi
2) omitting the > at the end of the title line in the phptest.php test file as given in the book (this prevented the php script working.)

Regards

Stephen Russell-Lacy

 
Old June 1st, 2004, 03:13 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Besides resources like you mentioned, it's always best to start at the PHP manual when you have a question about PHP.

This URL is an index of all the servers PHP.net has written how-to articles for:
http://www.php.net/manual/en/installation.php

Apache 1.x.x:
http://www.php.net/manual/en/install.apache.php

Apache 2.x.x:
http://www.php.net/manual/en/install.apache2.php

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old June 7th, 2004, 03:00 PM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just FYI, the reason the apache config lines in the book didn't work (specifically the "LoadModule..." line), is because the book uses Apache 2.0.47, not anything from the 1.3.x branch. Loading the "php4apache2.dll" module as stated in the book, in 1.3.x, will do nothing.

--Jason






Similar Threads
Thread Thread Starter Forum Replies Last Post
*.do URLs dont work in apache web server+tomcat haomomo Struts 1 August 29th, 2006 09:57 AM
Php/Apache blackout PHP How-To 1 August 22nd, 2006 08:16 AM
PHP 5.0 and Apache SeniorNSU BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 January 4th, 2006 10:26 PM
which is best :php with iis or php with apache? fromheavenz Beginning PHP 4 September 7th, 2005 01:47 AM
Need help with Apache and PHP yaluyahee BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 19 August 31st, 2004 02:49 PM





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