WebData Image

Notes to help you install PHP and MySQL - Provided by Rich Sias

I have edited the comments that I and others have made at end of March concerning all of my frustrations at installing the servers on my workstation. The solutions are included here too. Most of the problems are due to using 4.3/5.0 vs the web chapters are for ver 3.x. These instructions below are most useful for those following the web chapters while they wait for the real 2nd edition book to arrive by mail. Please note that the first 4 chapters are available for free on the internet! http://www.mysql.com/articles/ddws/

I started reading chap 1 and loaded in PHP, MySQL, and Apache. It is not easy getting all the pieces to "START" or to configure them. I have spent two hours installing and tuning and etc. I think I got Apache started manually, PHP is not running yet.

Who else is trying to install ?? Anyone successful yet ? I am running XP and d/l ver 5.0 beta PHP and set up manually. MySQL was 4.0.18 and Apache is 2.0.49. There is quite an extensive collection of notes to help install. I seem to have missed some things and cannot "START" the services correctly yet.

In reply to myself on my frustrations at loading Apache, PHP, and MySQL and getting them "STARTED", I succeeded now. The trip point was I tried to set a directory to use for PHP and I had to set the same as set in Apache. For me it is: N:\Program Files\Apps\Apache Group\Apache2\htdocs. I would like to change this "root" http directory to: P:/WWW/ - how would I go about changing Apache to that?

I already know how to change the PHP part cause I tried already. I had set doc_root = P:/WWW/ in the php.ini in windows directory. Messed me up until I put in the "N" path above into it instead.

I have continued on using the default directory for http development. Then I ran into problems passing variables from the html into the php process. Turned out things changed from Ver 3 to Ver 4&5 and all the examples are still level 3 so far. here is what I have done with the first variable passing exercise for php......You can't just address $var, but need to reference as: $_REQUEST["var"] or $_GET["var"] for GET methods and $_POST{"var"] for POST methods. I have working syntax for both variable assignment and use directly in echo() function.

Boy I keep finding more stuff on this variable passing problem. Try "register_globals = On" instead, default is Off. Several messages imply that I should leave it Off and work with the new standard usages. I modified and spell corrected the info before and now got more stuff working. See below for all the neccessary syntax needs. Both the $_GET[] and $_REQUEST[] work with the GET method. If everything is good then you will see: The var names transfer worked!!!! and the names will appear in proper places.

Things still to learn:
How to add space between first and last name in part with $_REQUEST[]
   hello.html <A HREF="welcome.php?firstname=Kevin&lastname=Yank"> Hi, I'm Kevin Yank! </A> <FORM ACTION="welcome.php" METHOD=GET>First Name: <INPUT TYPE=TEXT NAME="firstname"> <BR> Last Name: <INPUT TYPE=TEXT NAME="lastname"> <INPUT TYPE=SUBMIT VALUE="GO"></FORM>
   welcome.php
<?php # $firstnames=$_REQUEST["firstname"] # $lastnames=$_REQUEST['lastname'] $firstnames=$_GET["firstname"]; $lastnames=$_GET["lastname"]; echo( "Howdy doody, Welcome to our Web site, " . $_REQUEST["firstname"] . $_REQUEST["lastname"] . "<BR> more stuff here:<BR>");?> <br> <?php echo( "Welcome to our Web site, $firstnames . $lastnames ! . <BR> more stuff here:<BR>");?> <br> <?php if (!$firstnames || !$lastnames ) { echo "You have not entered all the required details.<br>" ."Please go back and enter data in all fields.<br>"; echo ".$firstnames., .$lastnames."; exit; } else echo "The var names transfer worked!!!!" ?>
=================

</body>
</html>

Return to top of page.