Forum Moderators: coopster

Message Too Old, No Replies

Apache? - PHP - MySQL - help!

Apache - PHP - MySQL

         

Protospleen

10:22 am on Apr 27, 2009 (gmt 0)

10+ Year Member



Hi All,

I'm fairly new to the idea of creating websites, but I have a decent programming background.

I've managed to get the whole html and CSS thing going..and I'm fairly literate with it now.

The next step is to introduce dynamic content using a database... after some research I realised that the apache/php/mysql option seemed the best...however, I am having some problems understanding how the apache piece fits in!?

I installed Apache using (localhost/localhost/myemail) and it seems to be installed ok. But what now? What am I expecting to see? How do I use this to start creating some OFFLINE mySQL databases...so that I can get to the fun part and start with the PHP scripting? Am I missing the point here?

I am also having trouble "starting a service" - or whatever that means? I don't have an "Apache.exe" in my "C:\Program Files\Apache Software Foundation\Apache2.2\bin" directory?

I also can't seem to see the "It's Working" thing on localhost address.

I realise this is a pretty broad question...but I would really like a better understanding of it all. If anyone can help I would really appreciate it!

** (update) - I updated the httpd.conf file to point to my HTML directory(where I write/test my websites) in the 'DocumentRoot' and 'Directory' statements.... but when I try to install the service, it says httpd: could not reliably determine the server's fully qualified domain name, using 192.168.1.3 for Servername" - and now I cannot start the service!? **

thanks..

[edited by: Protospleen at 10:35 am (utc) on April 27, 2009]

Protospleen

10:43 am on Apr 27, 2009 (gmt 0)

10+ Year Member



Woah! I've just seen that when I now connect to "localhost" - I get a ftp-style display of all the directories in my HTML folder (the one I described in my previous post for the httpd.conf file).... does this mean that it's working?

If I drill down into each directory...it shows me the corresponding website.

:)

belfasttim

6:06 pm on Apr 27, 2009 (gmt 0)

10+ Year Member



hi protospleen--

yeah sounds like you're on the right track-- for a dev server you usually have apache listening on port 80 of localhost or loopback (127.0.0.1) -- to actually see the rendered pages, after the php server bit has done its thing, you have to go through apache (by typing in [localhost...] or whatever into your web browser), simulating what a visitor will see in a real world situation.

What you're seeing with the "ftp" view is an apache directory listing-- you probably need to change the DirectoryIndex line in your apache conf-- this line tells apache what a valid index page is-- you may need to add index.php to the list in order for it to read the index (and therefore the site) properly.

Good luck.

Protospleen

9:03 am on Apr 28, 2009 (gmt 0)

10+ Year Member



Thanks belfasttim... I'll push on and see where it goes!

My next challenge is how to integrate the PHP scripting into my html documents, so that I can read the database entries I have created, and display them as dynamic content in the page.

I haven't found any examples of this scenario, and I'm not sure if I need to do all the php scripting INSIDE my html doc, or if I need to keep the scripts separate, and reference them from the html.

I'll get there...slowly..