By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

Need help getting hello-world working

P: n/a
System login message says PHP is available, so I tried this:
http://www.rawbw.com/~rem/HelloPlus/h.php
It doesn't work at all. Browser just shows the source.
What am I doing wrong?
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Robert Maas, see http://tinyurl.com/uh3t wrote:
System login message says PHP is available, so I tried this:
http://www.rawbw.com/~rem/HelloPlus/h.php
It doesn't work at all. Browser just shows the source.
What am I doing wrong?


Nothing.

Talk to you system admins or help desk. There's a problem with the
setup on your system.

Ken

Jul 17 '05 #2

P: n/a
> Robert Maas, see http://tinyurl.com/uh3t wrote:
System login message says PHP is available, so I tried this:
http://www.rawbw.com/~rem/HelloPlus/h.php
It doesn't work at all. Browser just shows the source.
What am I doing wrong?

From: "Ken Robinson" <ke******@rbnsn.com>
Nothing.
Talk to you system admins or help desk. There's a problem with the
setup on your system.


The full text of the login message regarding PHP is:
2001/06/11: PHP is available. To setup for an extension in your
site, use an .htaccess and do for example: AddHandler php4-script .php
If there are features or modules you need not in our copy let me know
and I'll consider adding it; do not compile your own.

When I originally read that in 2001, I had no idea what PHP was,
thought it was something used only on PPP dialup accounts, which I
didn't have, I have only VT100-shell dialup access, so I ignored it.

Then last year, when I first found out elsewhere what PHP meant, I took
the system message to mean that PHP is generally available, but if I
need to do something beyond the basic stuff I need to set up an
extension, sort of like installing an add-on to a Web browser to handle
macromedia or realsound or powerpoint or MS-Word etc., so I assumed
that for a simple hello-world example I wouldn't need to do anything
special, so I tried, but it didn't work.

Then somewhere in some thread on another topic, somehow my problem
seemed worth mentionning, so I did, and somebody responded to say that
PHP is disabled by default and I need to set up .htaccess to use it at
all. But I was busy with other tasks so I couldn't try it immediately.
Now months later I can't find that old thread and can't remember
exactly what the other person said. So last night after searching for
that old thread without success, believing I need to make such a file
but having no idea what is supposed to be in such a file, I blindly
went ahead and copied the example text from the system message to make
such a file on my home directory, but that didn't make PHP start
working for me. So then I spent another hour or two looking for that
old article, couldn't ever find it, so finally I posted here and you
responsed. Then this morning after seeing your reply I spent another
hour looking for that old thread, but still couldn't find it, so now
I'm back here telling you how desperate I am for your help.

So does that system message give you, a PHP expert, any clue that
there's some simple thing I need to do to activate PHP on my Web site,
or do I really need to bother the sysadmin about this?

By the way, if you're wondering why I'm wishing to use PHP here:
I would like to include PHP in my beyond-hello-world examples:
http://www.rawbw.com/~rem/HelloPlus/hellos.html#phpx
Jul 17 '05 #3

P: n/a


Robert Maas, see http://tinyurl.com/uh3t wrote:
The full text of the login message regarding PHP is:
2001/06/11: PHP is available. To setup for an extension in your
site, use an .htaccess and do for example: AddHandler php4-script .php
If there are features or modules you need not in our copy let me know
and I'll consider adding it; do not compile your own.


Well, did you put the line

AddHandler php4-script .php

in the file named .htaccess which should reside at the top most
directory of your web area (where your home page index.html resides)?

If you didn't, then do that and let us know what happens. If you did,
then talk to the support people.

Ken

Jul 17 '05 #4

P: n/a
> From: "Ken Robinson" <kenrb...@rbnsn.com>
(Google Beta is trashing your e-mail address, even in mode where it
claims it's showing me ORIGINAL format of your message.)
Well, did you put the line
AddHandler php4-script .php
in the file named .htaccess which should reside at the top most
directory of your web area (where your home page index.html resides)?


No, I hadn't done that. I had it in my login home directory. In
response to seeing your message here, I moved it from my home directory
to my public_html directory, and then tried to get into my Web site,
only to find that access is denied, can't view any files whatsoever
from my Web directory via HTTP. So I moved it back to my home directory
until you can tell me what to put in the file so I have any access at
all while still enabling php. Here's the current situation:

% ls -lt .ht*
2 -rw------- 1 rem user 28 Jun 25 02:08 .htaccess
% cat .ht*
AddHandler php4-script .php

As soon as you tell me what else goes in there, I'll put it there and
move the file to public_html to see what happens.
Jul 17 '05 #5

P: n/a


Robert Maas, see http://tinyurl.com/uh3t wrote:
From: "Ken Robinson" <kenrb...@rbnsn.com>

(Google Beta is trashing your e-mail address, even in mode where it
claims it's showing me ORIGINAL format of your message.)


It's called "munging", so spamers can't get it from google groups.
Well, did you put the line
AddHandler php4-script .php
in the file named .htaccess which should reside at the top most
directory of your web area (where your home page index.html resides)?


No, I hadn't done that. I had it in my login home directory. In
response to seeing your message here, I moved it from my home directory
to my public_html directory, and then tried to get into my Web site,
only to find that access is denied, can't view any files whatsoever
from my Web directory via HTTP. So I moved it back to my home directory
until you can tell me what to put in the file so I have any access at
all while still enabling php. Here's the current situation:

% ls -lt .ht*
2 -rw------- 1 rem user 28 Jun 25 02:08 .htaccess


On my machines the protection mask is "-rw-r--r--". Remember the
process that needs to read this file is not running under your name,
but usually runs under the name "nobody".

Ken

Jul 17 '05 #6

P: n/a
> From: "Ken Robinson" <ke******@rbnsn.com>
% ls -lt .ht*
2 -rw------- 1 rem user 28 Jun 25 02:08 .htaccess

On my machines the protection mask is "-rw-r--r--".


Aha, that was the final piece of the puzzle, thanks very much. I just
assumed it'd be Apache that was reading that file to check permissions,
so it didn't have to be group/other readable, since Apache is a system
daemon. Oh well. Anyway, I changed the protections, and moved the file
back to public_html,
2 -rw-r--r-- 1 rem user 28 Jun 25 02:08 public_html/.htaccess
and now not only were my regular Web pages still working but my php
test was working for the first time ever. So then I decided to run the
HTML validation service on not just that file but the master file that
shows all the hello and hello-plus examples, spent the whole day fixing
most of my stuff to be valid HTML transitional, and now with everything
looking good I finally have time to thank you and post the URL:
http://www.rawbw.com/~rem/HelloPlus/hellos.html#php0
Please take a look at it now, and if you're curious pop up to the top
of the main file and browse the contents.

Someday I should go on to the next step whereby the script produces
content that varies with time of day or user's IP number, with PHP as
I already did with: sh* perl lisp java
http://www.rawbw.com/~rem/HelloPlus/hellos.html#step1
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.