Jump to content


Enabling PHP


12 replies to this topic

#1 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 11 December 2006 - 06:04 PM

What changes do I have to make to my HTACCESS file for PHP to work on html pages?

#2 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 11 December 2006 - 07:50 PM

Stick this in your .htaccess

AddType application/x-httpd-php .html .htm


#3 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 11 December 2006 - 08:17 PM

so i just add that to the end of the code? if thats it, it didnt work.

Edited by PrisM, 11 December 2006 - 08:21 PM.


#4 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 11 December 2006 - 09:25 PM

Yeah... at the top of your .htaccess

Why don't you just change it to .php files. Second, are you even sure that you have php installed on your server?

Do this:

create a file called phpinfo.php and place this code inside the file:

<?php phpinfo(); ?>

Run that file through your browser and report the details.

#5 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 12 December 2006 - 12:30 PM

Yes it says it is installed. This is the php info page http://www.toon-work...net/phpinfo.php

The page that im looking for the php to display on is http://www.toon-work...cott-brown.net/ at the bottom in the stats pannel the date should appear.

#6 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 12 December 2006 - 12:32 PM

why not just rename your file to 'index.php'?

#7 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 12 December 2006 - 12:54 PM

because i know theres a way to just make php work on html pages, and its just easier for me to work with.

#8 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 12 December 2006 - 05:33 PM

this is what my htaccess file has in it:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName my authname
AuthUserFile my authuserfile
AuthGroupFile my group file

Where do i add that part of code into it?

#9 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 12 December 2006 - 06:33 PM

Add the code at the top of your .htaccess

AddType application/x-httpd-php .html .htm


#10 N4Z.

    Call me Yoda

  • Members
  • PipPipPipPip
  • 3,016 posts
  • Gender:Male
  • Location:127.0.0.1
  • Interests:Designing, Apple Fan Boy, Music Production and Weekends!

Posted 12 December 2006 - 06:43 PM

View PostChaos King, on Dec 12 2006, 11:33 PM, said:

Add the code at the top of your .htaccess

AddType application/x-httpd-php .html .htm

Notice how after all this it ends up you have to do what he said to do in the first place? It helps to listen. :)

"Its helps to click click, not cluck cluck"

#11 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 12 December 2006 - 07:15 PM

lol something about the server wont let me change the htaccess file without errors occuring. so i had no choice

#12 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 12 December 2006 - 09:45 PM

If your server won't let you change your .htaccess then you need to find a new host. You have to keep in mind though, hosts can choose what functions their users are allowed to run through .htaccess. AddType could simply be blocked on your server... in which case, you would need to find a new host.

If you're trying to do this because you have a hundred html files on your server and you don't want to rename them all, php could easily rename them for you with the file functions and str_replace().

#13 Hip Hop Artist

    Young Padawan

  • Members
  • Pip
  • 152 posts
  • Gender:Male
  • Location:Canada

Posted 12 December 2006 - 10:04 PM

ok thanks. i appreciate it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users