Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 16th, 2004, 10:02 AM
Registered User
 
Join Date: May 2004
Location: Stourbridge, West Midlands, United Kingdom.
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


Reply With Quote
  #2 (permalink)  
Old May 17th, 2004, 04:49 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
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/
Reply With Quote
  #3 (permalink)  
Old June 1st, 2004, 10:00 AM
Registered User
 
Join Date: May 2004
Location: Stourbridge, West Midlands, United Kingdom.
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

Reply With Quote
  #4 (permalink)  
Old June 1st, 2004, 03:13 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
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
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #5 (permalink)  
Old June 7th, 2004, 03:00 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.