473,491 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I experiment with php on my pc?

I want to be able to play around with some php scripting on my pc
without paying a company to host a domain.

I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, and I have downloaded and
installed the Abyss web server and that appears to be working. I also
have HTML Kit as my html editor.

How do I get simple php scripts to work properly on my pc though? Where
do I save the files?

I know this may sound so simplistic to some, but I'm getting a real
headache reading the php manual, frankly I don't understand half of it.

Regards

Feb 10 '06 #1
17 1886
In our last episode,
<11*********************@z14g2000cwz.googlegroups. com>,
the lovely and talented Denebola
broadcast on comp.lang.php:
I want to be able to play around with some php scripting on my pc
without paying a company to host a domain. I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, and I have downloaded and
installed the Abyss web server and that appears to be working. I also
have HTML Kit as my html editor. How do I get simple php scripts to work properly on my pc though? Where
do I save the files?
You can run php from the command line. I have no idea how you
do this if you are stuck in a GUI like Windows, but if you can
reach a command line prompt (and assuming php is in your path)
simply enter

php yourscript.php

where yourscript.php is, of course some script you have written.

redirect the output where you please:

php yourscript.php > mydoc.html
I know this may sound so simplistic to some, but I'm getting a real
headache reading the php manual, frankly I don't understand half of it.


I suggest you do not try to generate html pages immediately.

Try to get

<?php
echo "Hello, World!";
?>

to run first.

--
Lars Eighner us****@larseighner.com http://www.larseighner.com/
Fast, Cheap, Good: Choose any two.
Feb 10 '06 #2
Following on from Denebola's message. . .
I want to be able to play around with some php scripting on my pc
without paying a company to host a domain.

I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, and I have downloaded and
installed the Abyss web server and that appears to be working. I also
have HTML Kit as my html editor.

How do I get simple php scripts to work properly on my pc though? Where
do I save the files?

I know this may sound so simplistic to some, but I'm getting a real
headache reading the php manual, frankly I don't understand half of it.

1. Get plain html pages to show (The server will define a root directory
- you need to read those docs - Will take at least half an hour.)
*While doing this the server docs should tell you how to get it to start
and execute the php interpreter when it encounters a .php file request.*

2. Write helloworld.php and put it in same dir as a working html page
<?php print("Hello world"); ?>

3. Put http://localhost/helloworld.php (etc) into your browser and
Bob's your uncle.

The snag is with starred bit in step 1. I've never heard of Abyss - If
you can (and there may be good reasons why you can't) use Apache.

--
PETER FOX Not the same since the poster business went to the wall
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Feb 10 '06 #3

"Denebola" <si***@minnican.co.uk> a écrit dans le message de
news:11*********************@z14g2000cwz.googlegro ups.com...
I want to be able to play around with some php scripting on my pc
without paying a company to host a domain.

I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, and I have downloaded and
installed the Abyss web server and that appears to be working. I also
have HTML Kit as my html editor.

How do I get simple php scripts to work properly on my pc though? Where
do I save the files?

I know this may sound so simplistic to some, but I'm getting a real
headache reading the php manual, frankly I don't understand half of it.

Regards


You can install Easyphp or Wamp server on you're PC. Very easy. Install it
and it works.

Georges

Feb 10 '06 #4
Lars Eighner wrote:

You can run php from the command line. I have no idea how you
do this if you are stuck in a GUI like Windows, but if you can
reach a command line prompt (and assuming php is in your path)
simply enter


goto start->run->command

(you have to type command yourself)

That will give you something like the good old dos-screen. :P

Erwin Moller
Feb 10 '06 #5
Denebola,

The tutorials found here:

http://www.geocities.com/operationsengineer1/

seem to be pretty thorough.

You install Apache first, then PHP. If you want, you can install
PostgreSQL, too. it is a very nice open source database.

Feb 10 '06 #6
Message-ID: <sl********************@goodwill.io.com> from Lars Eighner
contained the following:
How do I get simple php scripts to work properly on my pc though? Where
do I save the files?


You can run php from the command line.


Why, when it is obvious that the OP is confused, do some people try to
confuse them further??

There are complete installations of PHP, Apache, MySql that you simply
double click to install.

Check out Xampp lite.

http://www.apachefriends.org/en/xampp-windows.html#646

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Feb 10 '06 #7
I agree with Geoff...

go to apachefriends and download the "lite" version and run it
it loads and configures apache, php, mysql, myadmin, perl and much more
if you've never done this before - there might be a learning curve to get over but it's the easiet
and fastest solution to turn your machine into a development server.


On Fri, 10 Feb 2006 18:58:39 +0000, Geoff Berrow <bl******@ckdog.co.uk> wrote:
Message-ID: <sl********************@goodwill.io.com> from Lars Eighner
contained the following:
How do I get simple php scripts to work properly on my pc though? Where
do I save the files?


You can run php from the command line.


Why, when it is obvious that the OP is confused, do some people try to
confuse them further??

There are complete installations of PHP, Apache, MySql that you simply
double click to install.

Check out Xampp lite.

http://www.apachefriends.org/en/xampp-windows.html#646


Feb 10 '06 #8
In our last episode,
<6d********************************@4ax.com>,
the lovely and talented Geoff Berrow
broadcast on comp.lang.php:
Message-ID: <sl********************@goodwill.io.com> from Lars Eighner
contained the following:
How do I get simple php scripts to work properly on my pc though? Where
do I save the files?


You can run php from the command line.

Why, when it is obvious that the OP is confused, do some people try to
confuse them further?? There are complete installations of PHP, Apache, MySql that you simply
double click to install.
So why are you trying to confuse people further. It runs from
the command line. What could be simpler than that?
Check out Xampp lite. http://www.apachefriends.org/en/xampp-windows.html#646


--
Lars Eighner us****@larseighner.com http://www.larseighner.com/
My mail reader can beat up your mail reader.
Feb 10 '06 #9
Message-ID: <sl********************@goodwill.io.com> from Lars Eighner
contained the following:
There are complete installations of PHP, Apache, MySql that you simply
double click to install.


So why are you trying to confuse people further. It runs from
the command line. What could be simpler than that?


Did you actually read what the OP posted?

"I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, "

No disrespect to the OP, but I suspect he or she will not be comfortable
with operating from the command line.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Feb 11 '06 #10
I have to agree that I would not be happy working from a command
prompt. I have written the simplest html page i can as follows:

<html>
<head>
<title>simple php test</title>
</head>
<body>
<?php

echo( "Hello World!" ) ;

?>
</body>
</html>

I have saved it in (index.html) the correct directory of my Abyss web
server, but when I call the page in IE by typing
http://localhost/index.html all I see is a blank page with the title
'simple php test'. It's almost as if the php part of the page is
ignored. I have installed php onto my webserver as instructed in the
abyss instructions. I'm very frustrated now. I'm probably missing a
very simple step somewhere here. I will try to install the Apache lite
version and try again. I'm determined to sort this out. Thanks for your
advice, and keep it coming.

Regards

Feb 11 '06 #11
Denebola wrote:

I have to agree that I would not be happy working from a command
prompt. I have written the simplest html page i can as follows:

<html>
<head>
<title>simple php test</title>
</head>
<body>
<?php

echo( "Hello World!" ) ;

?>

</body>
</html>

I have saved it in (index.html) the correct directory of my Abyss web
server, but when I call the page in IE by typing
http://localhost/index.html all I see is a blank page with the title
'simple php test'. It's almost as if the php part of the page is
ignored. I have installed php onto my webserver as instructed in the
abyss instructions. I'm very frustrated now. I'm probably missing a
very simple step somewhere here. I will try to install the Apache lite
version and try again. I'm determined to sort this out. Thanks for your
advice, and keep it coming.

Regards


I have to admit I have never heard of Abyss, I'm using Apache myself.
But your problem sounds like one of these two possibilities:

1) The webserver isn't configured to use PHP.

2) The webserver doesn't know that it should parse the file through PHP.
The solution to 2 is easy:

Webservers are usually configured to parse files that end in .php
through PHP, but not files that end in .html. So you either rename the
file to index.php or you reconfigure your webserver to also parse .html
files (the latter not recommended).

If that doesn't work you need to check the configuration of your
webserver. Check your webserver's manual. You don't need to read the PHP
manual yet, as it is a PHP command reference, which you will only need
once you start programming.

Bye!
Feb 11 '06 #12
Message-ID: <11**********************@g14g2000cwa.googlegroups .com> from
Denebola contained the following:
I have to agree that I would not be happy working from a command
prompt.


Thank you. I teach an introduction to programming class and know some
of the problems of getting started. The sheer amount of information is
available is very daunting for a newcomer and I find it useful to learn
just what you need to know at first and expand your knowledge later.
The learning curve is steep enough as it is. The manual is very
thorough and quite technical, but often there are examples of usage that
you can copy or adapt.

As for your test, it's been recommended that you rename the file
index.php This works exactly the same as index.htm or index.html except
that the php will be executed (it can be with other extensions but it is
not automatic - you have to configure the server to do so). However,
for testing I'd recommend you call it something meaningful e.g.
helloworld.php You can then build up a library of snippets that you can
call on as you progress.
--
Regards,

Geoff Berrow
Feb 11 '06 #13
What I have done:
- I first installed the webserver (personal webser that came with win98
in my xase)
- then installed PHP. the installer asked for a webserver, so I pointed
it to the one I had installed (was not reconised, but it is a version of
IIS, and pointing to IIS did the trick).
- Now the webserver can run .php files.

I have found a few Abysses, but this might be useful for you:
http://www.aprelium.com/abyssws/php.html

Where do you put the files?
That depends on the webserver. You probably have a webroot somewhere in
yoursystem. You can eiter make subdirectories under that webroot or add
a stie to your webserver.
Your webserver probaly has some managing option where you can add a site
or virtual directory. When you add a site, you have to give both the
virtual directory (http://localhost/yournewvirtualdirectory) and the
real directory (C:\your\real\directory\) that contains the files.

For a first test, just put the simple "hello world" example from PHP in
your webroot and see if that runs. If it doesn't, your webserver
probably does not know what to do with the .php extension.
Denebola wrote:
I want to be able to play around with some php scripting on my pc
without paying a company to host a domain.

I have downloaded php onto my pc, at least I think I have, a folder
called php has appeared on my C: drive, and I have downloaded and
installed the Abyss web server and that appears to be working. I also
have HTML Kit as my html editor.

How do I get simple php scripts to work properly on my pc though? Where
do I save the files?

I know this may sound so simplistic to some, but I'm getting a real
headache reading the php manual, frankly I don't understand half of it.

Regards

Feb 11 '06 #14
Well I must thank you all sincerely. I now have the ability to test
simple php scripting on my pc. I'm now using Apache as my webserver. I
do however have much to learn and will no doubt be asking similarly
simplistic questions in the very near future.

Kind regards.

Feb 11 '06 #15
Following on from Denebola's message. . .
Well I must thank you all sincerely. I now have the ability to test
simple php scripting on my pc. I'm now using Apache as my webserver. I
do however have much to learn and will no doubt be asking similarly
simplistic questions in the very near future.

Kind regards.

Well done.

If you haven't - go for version 5

There are quite a variety of styles of PHP programming ranging from a
few dribs and drabs in a HTML page to sophisticated frameworks[1] with
lots of variations in between. Look at a range of sources for examples
and tutorials to find the ones that suit your needs.

Databases are your friends. They are dead simple to use and once you've
got them configured are really handy.


[1] But don't expect them to work or be stable.

--
PETER FOX Not the same since the cardboard box company folded
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Feb 12 '06 #16
Well for the basics, try here: http://www.php.net/manual/en/

I found it helped me a lot when I was starting out.(Though WinLAMP came
with a local install of the manual)

Feb 12 '06 #17
I had similar newbie problems when I first started. Xampp lite got me
testing scripts locally in no time.

Feb 15 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1247
by: A.M. Kuchling | last post by:
As a half-hour hack, I took a copy of the Python docs, stuck them in a frameset, and added some JavaScript that displays a corresponding Wiki page in another frame. Feel free to play with...
1
1066
by: CrazyCube | last post by:
does any body got some files about Orthogonal Experiment?? i really need it now ,if anybody got ,please send them to me my mailbox is : yuxh312@hotmail.com
54
3936
by: CoreyWhite | last post by:
The following experiment is a demonstration of TIME TRAVEL. When writing this program, and testing it out I found that sometimes the program would engage itself in time travel but other times it...
4
2346
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
0
1060
by: egbert | last post by:
As an exercise in the use of dispatcher I concocted a Zoo with some Animals, see below. It works, but I think it is convoluted, obfuscated. The idea is that in the Zoo each animal needs its own...
11
4968
by: Chris Beall | last post by:
See http://pages.prodigy.net/chris_beall/Demo/photo%20block%20experiments.html I've ended up with what seems like a rather complex structure for what I thought would be a somewhat simple...
6
1304
by: joebenjamin | last post by:
Im tring an experiment that will generate 7000 integer random numbers and save them in an array. Then I need to copy these 7000 values into a second array, so that I have two identical integer...
34
2574
by: vippstar | last post by:
On Nov 17, 1:43 pm, Ertugrul Söylemez <e...@ertes.dewrote: Well your blog entry starts with which is untrue and a bad way to start an article. Reading further, in your code...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.