Current location: Hot Scripts Forums » Programming Languages » PHP » Installing PHP/mySQL for development on PC


Installing PHP/mySQL for development on PC

Reply
  #1 (permalink)  
Old 08-13-03, 06:49 AM
nevpugh68 nevpugh68 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Installing PHP/mySQL for development on PC

Hi there ! I'm just getting into PHP (learning from a book) ... I want to be able to test and try out my PHP scripts "offline", i.e. working on my development machine.

Do I have to install Apache or IIS before I can install PHP ? Can I get away without having Apache ? (it just seems overkill when all I want to go is play with PHP)

I'm running a Windows XP or 2000 machine btw.

Many thanks !
Reply With Quote
  #2 (permalink)  
Old 08-13-03, 08:01 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
you will need apache or IIS on your PC as this provides the webserver environment which is crucial for two resons:

1) the webserver will parse the php, in plain english PHP will work.

2) it would help you get to grips with server administration and configuration, which comes in handy for the future and will give you a few more options when working with large of complicated projects.

*please* go for apache :-)
Reply With Quote
  #3 (permalink)  
Old 08-13-03, 08:47 AM
nevpugh68 nevpugh68 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, fair enough ! :-) Thanks, it's kind of what I suspected ...

Er ... when installing Apache (oh go on then, you talked me into it ! ;-) is it a case of just run the install (on Win2k) or is there lots and lots of parameters to set up ? (remembering I dont want to actually run a web server from it, just create PHP pages on the PC)

Tx !
Reply With Quote
  #4 (permalink)  
Old 08-13-03, 10:49 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Once you have run the install, you shouldn't have too much to do.

http://hotwired.lycos.com/webmonkey/...tml?tw=backend

this will help you *a lot* :-)

basically there is a file in /httpd/conf called...wait for it...httpd.conf, and this the file that contains the configuration apache uses.

http://httpd.apache.org/docs/ (version 1.3)
or
http://httpd.apache.org/docs-2.0/ (version 2.0)

are the links to the official apache documentation. 1.3 will do the job, a lot of people aren't using version 2.0 yet. i work for a web hosting company and we use 1.3
Reply With Quote
  #5 (permalink)  
Old 08-13-03, 12:05 PM
IndyTim IndyTim is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Indianapolis, Indiana USA
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

Another approach is to get one of the many WinInstall bundles that are out there. Most come with PHP, MySQL and Apache ready to install on a Windows machine.

IndyTim
__________________
Believe those who are seeking the truth; doubt those who find it.
-Andr Gide
Reply With Quote
  #6 (permalink)  
Old 08-13-03, 02:11 PM
nevpugh68 nevpugh68 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Er ... help !!

Someone recommended Foxserv to me as one of these "all in" bundles with Apache, PHP and mySQL all in.

So I've downloaded Foxserv (all 37mb of it) and installed it, taking all the default options, onto my Win2k machine. All appeared to work fine.

Quick reboot later for good measure, and mySQL is working fine (I can get to it's control panel via Foxserv, and see the test and mySQL databases), Apache appears to be working fine (I can see localhost and mooch around a few localhost pages etc) but PHP refuses to work ! (a simple .php file doesn't run, you see a mish mash of the PHP code instead in IE6)

I've checked that httpd.conf contains a loadmodule and an addtype row for PHP (as set up by the Foxserv install)

But I'm totally at a loss what to try next ?!?
Reply With Quote
  #7 (permalink)  
Old 08-13-03, 03:33 PM
nevpugh68 nevpugh68 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, I think I've sussed it to a degree. I didn't realise you couldn't just open .php files in IE, you have to "publish" them to http://localhost/mypage.php

But why am I getting this error from a script in the book I'm reading ?

Parse error: parse error, unexpected T_ECHO in C:/FoxServ/www/hello.php on line 5

... from this simple hello world page ?!? ....

< html>
< head>
< body>
< ?php>
echo ?< p>Hello World!?
?>
< /body>
< /html>

(ignoring the extra spaces after the < of course)

Argh ! Frustration ! Any help gratefully grasped ....
Reply With Quote
  #8 (permalink)  
Old 08-13-03, 03:46 PM
Godsmack Godsmack is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
The PHP should look something like this:
PHP Code:

<?php 

     
echo "<p>Hello World!?"
?>
Reply With Quote
  #9 (permalink)  
Old 08-13-03, 04:08 PM
nevpugh68 nevpugh68 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Spot on ! Thanks.

However this has given me no confidence whatsoever in my new book, as how I copied it is how it is in the book and on the CD ! Great start .... wonder how many of the other examples have errors in them ....

But, thanks all for your help :-)
Reply With Quote
  #10 (permalink)  
Old 08-14-03, 06:14 AM
XMLMania.com XMLMania.com is offline
Newbie Coder
 
Join Date: Aug 2003
Location: England
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
IMO you should use Microsoft IIS, because not only can u install PHP, Perl etc, but you can also have ASP running, and if you download the .NET framework you can also run many other languages, the major one being ASP.NET.
__________________
-- <a href="http://www.xmlmania.com">XMLMania.com</a> --
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I Need a PHP/mySQL Programmer pelican Job Offers & Assistance 6 09-23-03 06:12 PM
I am looking for PHP/MySQL work heat23 Job Offers & Assistance 1 07-23-03 09:44 AM
Free PHP/MySQL hosting! Psykho General Advertisements 3 07-11-03 03:21 AM
I need a PHP/MySQL coder to help with my site. bhoard Job Offers & Assistance 8 07-07-03 10:25 PM
Custom PHP/MySQL Programming Job relledge Job Offers & Assistance 0 06-12-03 09:41 PM


All times are GMT -5. The time now is 05:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.