Hi - Newbie Question. Trying to configure Apache to run PHP

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
domh_789
Forum Newbie
Posts: 5
Joined: Thu Dec 15, 2005 9:59 am

Hi - Newbie Question. Trying to configure Apache to run PHP

Post by domh_789 »

I recently bought the SAMS Teach Yourself PHP, Apache and MySQL 2nd Ed. book.

It comes with:

PHP 5.0.2
MySQL 4.0.21
Apache 2.0.52

Running on Win XP home.

Following the instructions to the letter, I succesfully installed MySQL and Apache. Checked the Apache service was running OK.

For the life of me I cannot get the PHP up and running.

The book states I should first alter the httpd.conf file to include:

LoadModule php5_module c:/php5/php5apache2.dll

AddType application/x-httpd-php .php .phtml . html

And rename and move php.ini-recommended to php.ini to c:\windows
And move php5ts.dll to c:\windows\system32

Restarted the Apache service - no problem

But when I creat a test page 'phpinfo.php' and save in the htdocs directory I get the message 'HTTP 404 - File not found'

Help please! Has anyone else encountered this problem, I'm sure it's easily rectified, but being new to it all I'm struggling!

Thanks in advance,

Dom
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Do you get a page not found error when you go to: http://localhost/
domh_789
Forum Newbie
Posts: 5
Joined: Thu Dec 15, 2005 9:59 am

Post by domh_789 »

Hi there,

sorry for the delay in getting back to you.

I have no problem displaying the 'default' page http://localhost/

The problem occurs when I try and create a PHP test page....get a page not found error

any ideas?

cheers,

dom
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Are you sure you are putting the file in the right directory? (Document Root)
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

also, did you restart apache?
domh_789
Forum Newbie
Posts: 5
Joined: Thu Dec 15, 2005 9:59 am

Post by domh_789 »

Hi, thanks for your replies

The 'phpinfo.php' file is saved in the htdocs directory. Apache has been restarted! Any more ideas?


Thanks

BTW, has anyone else bought this book? Because I'm coming to the conclusion that it's not very well written!
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Nope haven't read the book. If this is your first time setting up Apache/MySql/PHP. May I recommend Xampp http://www.apachefriends.org/en/index.html

It will make your life much easier.

Note: you will prob. have to uninstall apache before you install Xampp
Simon.T
Forum Newbie
Posts: 6
Joined: Tue Dec 20, 2005 5:36 am
Location: Malaga, Spain

Post by Simon.T »

I would deffinately recommend unistalling all existing services this includes apache and mysql before installing XAMPP, XAMPP has been great for me but better to install from fresh with no existing components

(Remember to back up any data first)

Simon
domh_789
Forum Newbie
Posts: 5
Joined: Thu Dec 15, 2005 9:59 am

Post by domh_789 »

Yep, it's my first time, I'll give XAMPP a go tonight. I also considered giving WAMP5 a go http://www.wampserver.com/en/index.php.

Many thanks

dom
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

Well, I knew there was a full package available somewhere when I installed my local server a few weeks ago, but forgot the name, and couldn't be bothered searching.

I installed Apache first, then PHP and it took me about an hour in total to get it working, I haven't attempted MySQL yet, but I can't imagine it would be that difficult to set up. I had to refer to some user notes on php.net about installation a few times, they are quite helpful.
Simon.T
Forum Newbie
Posts: 6
Joined: Tue Dec 20, 2005 5:36 am
Location: Malaga, Spain

Post by Simon.T »

only thing i can think to say about wamp5 is that its for php5, not all web hosts are supporting this yet so make sure to check what your configuration is on the webserver your going to be using.

PHP5 is quite a bit different from php4 but i`ve never looked at php5 so don`t uote me on any of this!

Simon
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Simon.T wrote:only thing i can think to say about wamp5 is that its for php5, not all web hosts are supporting this yet so make sure to check what your configuration is on the webserver your going to be using.

PHP5 is quite a bit different from php4 but i`ve never looked at php5 so don`t uote me on any of this!

Simon
It's mostly backward compatible. A few function changes/additions. OOP has introduced a lot of new features but the PHP4 stuff should basically still work.

Going from 4 to 5 should be easy enough, but if you've learned loads of PHP5 specific things you may find it confusing to drop down to PHP4.
Simon.T
Forum Newbie
Posts: 6
Joined: Tue Dec 20, 2005 5:36 am
Location: Malaga, Spain

Post by Simon.T »

d11wtq wrote:It's mostly backward compatible. A few function changes/additions. OOP has introduced a lot of new features but the PHP4 stuff should basically still work.

Going from 4 to 5 should be easy enough, but if you've learned loads of PHP5 specific things you may find it confusing to drop down to PHP4.
Thats what i was basicaly referring to is if atest server is running at the office / home with php 5 and scripts run ok, but then you upload to your really server only running php4 then theres gonna be problems

I always try and run exactly the same version of software on the local test server as the real web server.

Simon
domh_789
Forum Newbie
Posts: 5
Joined: Thu Dec 15, 2005 9:59 am

Post by domh_789 »

Thanks all for your comments,


got it all up and running using WAMP......very straightforward!

cheers,

dom
Post Reply