Localhost doc - Critique please?

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Localhost doc - Critique please?

Post by Jonah Bron »

Hi,

I made a doc on how to setup a localhost on one's comp. I sent it to a moderator (Everah) to be posted under "Tutorials", who suggested I post it here for critique. Well?

http://nucleussystems.com/blog/network/localhost.php
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Good idea. I noticed that the folder name of your Apache installation and its location in a Windows directory tree is quite different from the default installation that I used when I installed Apache on Windows a year or two ago. It may require a bit of research to find out what it currently is, and perhaps you should mention that the location and folder name might be different, depending on when Apache was installed, or maybe where you obtained the download.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Thanks for the critique. I did those suggestions, and also did some changes to increase it's general readability. Anybody else?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

It's interesting that our installation directories for both Apache and PHP are so different. Perhaps because of the versions. I used the defaults in all cases, since I had no knowledge of any reason to do it differently. My Apache was installed in C:\Program Files\Apache Group\Apache\ (my old Apache 1.2 or whatever it is) and C:\Program Files\Apache Group\Apache2\ and my PHP installed in C:\PHP\ (not under Program Files). So be sure you either know for sure that the current versions install the way you described, or mention that it might be different, as you did for Apache.

It's a good effort and I think some people will find it very helpful.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I think when you download php, a php.ini file is not available. I think there's two, php.ini-recommended and php.ini-dist, of which you have to rename one of them to just php.ini.

I didn't see that mentioned.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think the title of the tutorial should be changed to make it clear that it is about setting up Apache and PHP to run as localhost on Windows. On Unix it is a different procedure.
(#10850)
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

is the php.ini-recommended and php.ini-dist on unix? I ask, because when I installed php, (windows) there was no renaming or anything. :?

I changed the title, as you suggested, arborint. Thanks so far. :)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

PHPyoungster wrote:is the php.ini-recommended and php.ini-dist on unix? I ask, because when I installed php, (windows) there was no renaming or anything. :?

I changed the title, as you suggested, arborint. Thanks so far. :)
Not sure. But, on windows, you have to rename.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Hmm. Okay, I'll put that in. Thanks.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Personally I would just download and install Xampp :wink:
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

CoderGoblin wrote:Personally I would just download and install Xampp :wink:
Then you miss out on being able to understand how to set up Apache and PHP, which is useful to know, especially when applying for jobs as a PHP developer.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Whilst this is true, for any tutorial, mention should be given to alternatives. Just looking at the title with "localhost" suggests a testing environment which normally you want set up quickly and the same each time if you need to recreate it. More detail would be required for a live system regarding things like security settings etc. Having installed Apache and PHP on both Linux and windows loads of times I now go for the easiest method when needing a testing environment.

Getting basic information such as that provided by phpinfo() is always a useful thing to know, not least to check which php.ini is actually being used if you have a couple scattered around.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

superdezign wrote:
CoderGoblin wrote:Personally I would just download and install Xampp :wink:
Then you miss out on being able to understand how to set up Apache and PHP, which is useful to know, especially when applying for jobs as a PHP developer.
Very, very true. If I had setup a preconfigured apache/php/mysql, I would'nt have known anything when I went to edit files and change configurations. Reading all of the setup files and what they do is a huge +. I'd keep your tutorial as is, I wouldn't even put in links to alternative "bundle" packages, as suggested. Everything is about learning! and there's no better way to learn than doing everything manually.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

scottayy wrote:Everything is about learning! and there's no better way to learn than doing everything manually.
Agree in principal but the tutorial introduction states....
tutorial wrote:This page goes through the steps of installing APACHE web server, and PHP.
not "whilst there are alternative methods this will step you through the process to enable you to understand what is going on...".

I know it's a case of symantics but an important one. Are we trying to get something working here or teach. If we are trying to teach at the same time, a simple "Do this followed by this" doesn't work without some additional background information. At its simplest level this additional information could be links to other web sites containing the necessary information. I guess to sum up my feelings, in it's current state this is a simple guide rather than a tutorial.

Examples of additional information required include...
What is the purpose of the php.ini file and what is it responsible for ?
What sort of things are extensions ?
What is localhost (some mention of IP address 127.0.0.1 etc here would be useful) ?
tutorial wrote:Now, try some PHP!..
should actually include a php file example that should work e.g.

Code: Select all

<?php phpinfo(); ?>
as I have been suprised at how often people try to test with complex php code which has errors and think the installation is wrong when they get a blank page..

Whilst it may be obvious to many that this is a "testing" environment, to beginners it may not be and this should be mentioned.

Hope I'm not putting you off PHPyoungster. We need more people like you to add useful tutorials.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Receiving info..processing...beep...beep...processing complete

:cry: you don't like it? (snif snif)

I'm trying to make this sort of a preperational tut for the ultimate: Setting up a web host (once I get a server comp. and figure it out). I will do what you said, CoderGoblin, and add the <?php phpinfo(); ?>, and the fact that there are other alternatives. Thanks. 8)
Post Reply