-1

Goal: Executing HTML files that contain PHP commands(like this which is just a basic script to demo. The only output I get is Welcome to my home 1page, the hello world from the PHP is not running)

If I can get this to run I have PHP to extract data from a database.

Problem: Despite changing the .htaccess file located at the root domain of butlinsminehead.co.uk nothing that I add has any effect. I have many options

including AddHandler php-fastcgi `.php` `.php5` `.php72`
AddType text/html `.php .php5 .php72`
DirectoryIndex index.php index.php5 index.php72

I believe I am running php7 although this is the output:

System  Linux zebedee3.namesco.net 2.6.32-754.6.3.el6.x86_64 #1 SMP Tue Oct 9 17:27:49 UTC 2018 x86_64
Build Date  Sep 20 2016 12:10:20
Server API  CGI/FastCGI

Does anyone know what the .htaccess file should contain, please?

The HTML is running in a subdomain for butlinsminehead.co.uk

Rarblack
  • 4,559
  • 4
  • 22
  • 33
bitzer
  • 3
  • 2

1 Answers1

0

You need to set the proper type, which is application/x-httpd-php instead of text/html.

You can read the AddType directive as *X type is handled by Y files` so:

AddType text/html .php .php5 .php72

Would be Html type is handled by PHP files and what you want is PHP type is handled by HTML files:

AddType application/x-httpd-php .php .php5 .php72

If it doesn't work you try with application/x-httpd-php5.

aiko
  • 423
  • 1
  • 4
  • 11