Page 1 of 1

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

Posted: Thu Dec 15, 2005 10:20 am
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

Posted: Thu Dec 15, 2005 12:39 pm
by hawleyjr
Do you get a page not found error when you go to: http://localhost/

Posted: Mon Dec 19, 2005 10:09 am
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

Posted: Mon Dec 19, 2005 10:33 am
by hawleyjr
Are you sure you are putting the file in the right directory? (Document Root)

Posted: Mon Dec 19, 2005 10:41 am
by Burrito
also, did you restart apache?

Posted: Tue Dec 20, 2005 5:55 am
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!

Posted: Tue Dec 20, 2005 8:35 am
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

Posted: Tue Dec 20, 2005 8:42 am
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

Posted: Tue Dec 20, 2005 8:47 am
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

Posted: Tue Dec 20, 2005 8:52 am
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.

Posted: Tue Dec 20, 2005 8:52 am
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

Posted: Tue Dec 20, 2005 9:14 am
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.

Posted: Wed Dec 21, 2005 7:42 am
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

Posted: Thu Dec 22, 2005 7:31 am
by domh_789
Thanks all for your comments,


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

cheers,

dom