[sclug] php problems

Graham lists at Information-Cascade.co.uk
Sun Sep 4 13:57:03 UTC 2005


Stuart,

> Created hello.php using Kate with
> 
> <? phpinfo(); ?>
> 
> as it's contents and then got back a large page of details abot the php 
> version.

	You wanted to upload a php file (via ftp),
	and fetch it (with http), and have the web-server filter-it using php.
	It worked!

	Use the SAVE-AS menu/button/command to keep those details,
	there is a lot if interesting info in there. Read them now,
	and again every 2 months. Each time you'll understand a bit more.

	EG did you fetch the web page from a remote server or the local image?

> >	If that works, rename the file to hello.html, and see if it still
> >	gets pre-processed by the php part of the web-server.
> >	Do you get it back raw or cooked?

...
> and then try to access www.thebluejays/hello.html I get nothing, but I 

	That also worked! It came back raw.
	So its all in the filename.extension.

	When you get nothing, you didnt get error-404-not-found.
	If you press CTRL-U (VIEW/Source) you will see the actual text.

	Tht text is valid PHP. but not valid HTML, and appear blank.
	With proper HTML contents you will see more

		<HTML
		 <HEAD>
		  <TITLE> This is used as the window border title, etc </TITLE>
		 </HEAD>
		 <BODY>
		  <H1> Top level (H1) headers look naff </H1>
		  <P>	Some
			Paragraph
			Text 
		  </P>
		  <H2> Secend level (H2) headers look good </H2>
		  <UL>
		   <LI>	An un-numbererd-ordered list (UL) isnt numbered </LI>
		   <LI> A Bullet point list </LI>
		   <LI> With lots of (LI) List Items</LI>
		  </UL>
		  <H2> Todays Spilling Mistake </H2>
		   <PRE>
			Pre
			 Formatted
			  not wrapped

			IS PHP RUNNING:

				<?php
					echo "PHP MAY BE FILTERING THIS MESSAGE";
					echo date("l dS of F Y h:i:s A");
					// but not if you can see this comment
				?>
		  </PRE>
		 </BODY>
		</HTML>


> still get all the details about the php version when I try /hello.php 
> despite having removed the file?

	Browsers sometimes cache an old result, and keep it when you dont want them to.
	Introduce a full-stop, spelling error, or date, to check that it changes.

> Does this shed any light on my problem?

	One last point: please learn about X11 CUT+PASTE
	(highlight, middle-button, sometimes with SHIFT pressed for TEXT oriented clients).
	That makes reporting exact error messages, directory names a bit easier.

	If you have the above HTML file, working with/without php,
	try introducing a syntax error, to see what comes back.

> Thanks, Stuart.

	You wanted a php processed file.
	It worked!

	(What were you doing when it DID work - no superstitions allowed ;-)

--
 Graham


More information about the Sclug mailing list