Apache 2 server on ubuntu can't parse php code inside html file

前端 未结 4 2038
北荒
北荒 2020-12-17 07:32

I installed apache2, php5 and the php5 apache module on Ubuntu 13.04.

Php is working on .php files but lines of php code inside html files do not execute.

Go

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 07:57

    Got it to work. my version of apache doesn't have httpd.conf, instead has php5.conf in /etc/apache2/mods-enabled/

    editing that file, found this:

    
        SetHandler application/x-httpd-php
    
    
        SetHandler applicatio
        ....
    ....
    

    added the lines:

    
        SetHandler application/x-httpd-php
    
    

    now php parses the html files and code works.

提交回复
热议问题