Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
program file extension .php4

Posted by charles.wroth (charles.wroth), 12 August 2003
Hello Graham.  Thank you for sending the course examples, which I've now extracted to files.

During our course, each of the program files we created had a filename extension of  .php4  - but my Windows (XP) system only works when I change them to  .php  instead.

It took me a while to work out why the  .php4 s weren't working...  Is there a config option or something?  It seems fairly basic info, so I did a search but couldn't find anything helpful.    Thank you...  Charles.

Posted by John_Moylan (jfp), 12 August 2003
Hello Charles.

What Webserver are you running?
This is a setting in the webserver configuration file

Let me know which it is, I'll be happy to look for you.

jfp

Posted by charles.wroth (charles.wroth), 12 August 2003
Thank you, jfp!  Pardon my ignorance - I'm running Apache.  Is that what you need to know?    Charles.

Posted by John_Moylan (jfp), 12 August 2003
>> I'm running Apache.
Great, For a moment I thought you were going to say IIS (yuk!)

Anyway, you need to edit your apache configuration file.
This goes under the name of httpd.conf, I'm afraid I couldn't tell you the location of this file under windows, but a quick search will find it.

First....BACKUP YOUR EXISTING httpd.conf FILE.
Sorry to shout, but I've buggered up my own conf file in the past, and a nice quick roll back is always nice.


Open the httpd.conf file for editing.
You say it will parse a .php extension, so look for the line that reads:

Code:
AddType application/x-httpd-php .php

Then add .php4 to the end of the line so it should now read:
Code:
AddType application/x-httpd-php .php .php4


My httpd.conf file as an example has 4 entrys that start with the string "AddType application/x-httpd-php" and my file reads like this
Code:
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php .php .php4
AddType application/x-httpd-php-source .phps

This tells apache to parse .php & .php4 files through the PHP preprocessor.


---------------------------------------
Now you need to tell apache that .php or .php4 extension can be index pages.

Look for the line that starts with:
Code:
DirectoryIndex index.html

There may already be an entry near the end of this line that reads index.php, you need to add index.php4

my http.conf file as an example reads like this on that particular line
Code:
DirectoryIndex index.html home.html index.htm home.htm index.php default.php home.php


Now a restart of Apache to reload the configuration and that should work.

post back if there's any problems.

Regards
jfp

Note: I'm sure you can also do this by ammending your .htaccess file (anyone?) to allow other filename extensions to be parsed through PHP.

Posted by charles.wroth (charles.wroth), 12 August 2003
That's terrific - thanks a lot.    Charles.

Posted by Chris_Isaac (Chris Isaac), 13 August 2003
Quote:
Note: I'm sure you can also do this by ammending your .htaccess file (anyone?) to allow other filename extensions to be parsed through PHP.


Yes, this will work as well. If you add it to your top directory it will filter it down, or if you add it to a directory below, it will effect only directories below it.

Chris



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho