[sclug] Re: php problems

Graham lists at Information-Cascade.co.uk
Sat Sep 3 10:01:00 UTC 2005


	Connect with gftp, SSH or the site-admin facility.

	look at the files that are there - and were there when you started
	Is there a directory called "htdocs" ?
 
	Thats where you place your web-files and sub-dirs.
	(It varies with each ISP)

	You dont need to set 'permissions', thats a red-herring,
	as you are NOT using htdocs/cgi-bin/ (yet). The key feature
	is the filename.php extension, which tells apache to run php over it.
	You can upload ANY kind of file, with ftp, then ask for it back with http

		http://www.thebluejays.co.uk/hello.txt - with a simple message

	But its more interesting to get

		http://www.thebluejays.co.uk/hello.php -   <? phpinfo(); ?>

	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?

> >> > Stuart Major wrote:
> 
> The error I get is:
> 
>  Forbidden
> 
> You don't have permission to access / on this server.
> Apache/2.0.54 (Red Hat) Server at www.thebluejays.co.uk Port 80
> 

	Thats the message Apache sends instead of 'index file not found'.

	You asked for a directory ('/' the root dir, which is probably $HOME/htdocs)
	Apache auo-tried /index.html and /index.php - neither existed
	Apache then wanted to generate an auto list of files in that dir
	but the .htaccess configuation says dont, hence forbidden.

> >> > Then you need to tell Apache that files ending in
> >>".php" should be 
> >>interpreted as PHP files.

	this will (probably) be already set

> >>How do I tell Apache about the .php files, I have a
> >>index.php file that 
> >>I presume initiates the site in some way?
> >>

	you put them there,
	you ask for them by name,
	or index.php by special-case name

--
 Graham


More information about the Sclug mailing list