Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 + php, .php works but <?php tag won't
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
apoc2222
n00b
n00b


Joined: 18 Dec 2003
Posts: 44
Location: Hamburg, Germany

PostPosted: Fri Dec 26, 2003 4:01 pm    Post subject: apache2 + php, .php works but <?php tag won't Reply with quote

Apache processes only .php files with php, in .html files the <?php tag is ignored by apache :( I have no clue where ti fix this, any suggestions?

Thanks!
Back to top
View user's profile Send private message
monotux
l33t
l33t


Joined: 09 Sep 2003
Posts: 751
Location: Stockholm, Sweden

PostPosted: Fri Dec 26, 2003 6:26 pm    Post subject: Reply with quote

apache is supposed to ignore processing <?php in a .html document.
there is no fix for that.
_________________
Computer science is no more about computers than astronomy is about telescopes.
Back to top
View user's profile Send private message
khel
Tux's lil' helper
Tux's lil' helper


Joined: 07 Mar 2003
Posts: 80

PostPosted: Fri Dec 26, 2003 6:27 pm    Post subject: Reply with quote

As far as I know, if apache processes .php files, then it should work with php in .html files as well. Does it give you an error? And if so, what does it say?
Though, most likely, you have a sintax error or configuration issue.

khel
_________________
If it's stupid but works, it isn't stupid.
Using Gentoo? Help the others!


Last edited by khel on Fri Dec 26, 2003 6:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
khel
Tux's lil' helper
Tux's lil' helper


Joined: 07 Mar 2003
Posts: 80

PostPosted: Fri Dec 26, 2003 6:36 pm    Post subject: Reply with quote

retribrute wrote:
apache is supposed to ignore processing <?php in a .html document.
there is no fix for that.


How about this fix? (maybe that was the problem)

First way

For apache, look in the apache/conf/ directory for your httpd.conf file and look for lines like these: AddType application/x-httpd-php4 .phtml .pwml AddType application/x-httpd-php4 .php4 .php .php3 .php2 and put whatever extensions you want in there.

Second way

edit the directory configuration file (.htaccess for apache) and add:

AddType application/x-httpd-php .php .phtml .php4 .php3 .html .htm

khel
_________________
If it's stupid but works, it isn't stupid.
Using Gentoo? Help the others!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum