Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 February 17th, 2007, 07:58 PM
Red Red is offline
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Apache / PHP First time set up

Hi, I am totally new to using apache/mysql/php and am trying to get everything set up by the Wrox book "Beginning PHP,Apache,MySQL Web Development". Everything seems ok except for a couple of spots and I think the problem is the version I'm using now verses the versions used in the book?

So in the book it says it's using Apache 2.0.47 and PHP 4.3.3

I verified Apache is running by going to http://localhost/ and getting the welcome message. No problem so far.

Then it says I need to customize the installation by adding PHP to the equation. It instructs me to add the following lines to my httpd.conf file. (See Question #1)
AddType application/x-httpd-php .php3 .php
AddType application/x-httpd-php-source .phps

And then to add the PHP module to my httpd.conf program so that Apache can parse the PHP so added the following line: (See Question #2)
LoadModule php4_module c:/php/sapi/php4apache2.dll

I have PHP 5.2.1, Question #1: Do I have to change the code to reflect the newer PHP version? Because I tried to do this but it didn't seem to work? (Not sure if this is because of the second part of this question)

Question #2: Do I need to change the LoadModule code to reflect the newer version of PHP? because I could find the php5apache2.dll file but I could not find the sapi listed in the path. When I removed the sapi the Apache server would run but not recognize any php code?

If anyone could just tell me what I am supposed to do based on my version I would appreciate it. I bought the book and figured I'd follow it step by step lol and just my luck the versions changed.

Thank you.

 
Old February 22nd, 2007, 08:17 AM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

That surely seems like a rough start with php. These settings seem pretty
unnecessary for someone who start with php. If you want mysql to work with php Try downloading xampp thats will do all these settings for you.
When you done with the installation just start playing with the code.

Oh and there are some minor syntax changes with php 5.1 compared to 4.1 but it is most unlikely that you are gonna bump in a problem like that. Its more likely you are bumping into trouble when you are using php 4.1 which is a real pain with OOP programming.



__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
 
Old February 22nd, 2007, 10:21 AM
Authorized User
 
Join Date: Feb 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi Red,

I too had the same problem, i was able to solve it by using:--

LoadModule php5_module c:/php/php5apache2_2.dll

this php5apache2_2.dll file, is present in the php folder present in the C drive ( this is coz i insatalled php from the C drive, from the example u have given i guess that yours too installs from C drive.) I assume that as u r new to apache/php u must have downloaded the Apache2.2.x version from the Apache software foundation's file.
the php5apache2_2.dll is must while using the apache 2.2.x version with php5.2.1.

i guess this solves ur problem, if not scrap back on this thread, and we'll try to figure it out, me too following the same book so we can help each other better.






Similar Threads
Thread Thread Starter Forum Replies Last Post
set time zone in PHP 4.4.4 crmpicco PHP How-To 0 November 4th, 2007 01:15 PM
Php/Apache blackout PHP How-To 1 August 22nd, 2006 08:16 AM
set Apache Tomcat 5.0 webserver visible in network briss Apache Tomcat 4 July 12th, 2006 08:13 AM
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.