Cheap Web Space, Domain Name:
Web Space With E-Mail, PHP/MySQL.

How to execute PHP code in a page that ends on .html or .htm?

Question: 

Searching …

 

Unfortunately nothing found on "".

Premium support for Bitpalace web hosting customers only!

 from New Zealand: +49 30 32 70 18 92, Fax (in Germany) +49 30 32 70 18 91

service@bitpalast.net 

Skype: bitpalast

One moment please … your browser is loading the page.

 

 

Symptom

You have a PHP script or an HTML page with built-in PHP commands but want to name that file *.html and not *.php. Unfortunately the web server only interprets .php-files as PHP code. In an .html-page it displays the PHP code as plain text instead.

 

Solution

Create a text file named ".htaccess" in the document root directory of your website. Enter the following line. If an .htaccess-file already exists, add the line to that file:

AddHandler php-script .html .htm

By using this line the web server knows that it ought to parse .html and .htm files for PHP code and that it ought to interpret -segments as PHP commands. Please note that this .htaccess command will work on Bitpalace shared hosting web space, but may not work on web space of other providers.

Then add the following lines to the "Additional configuration directives" section with the PHP icon in the webspace control panel:

[php-fpm-pool-settings]
security.limit_extensions = .php .phar .html .htm .inc

Add the following additional lines to the "Additional directives for HTTP" and "Additional directives for HTTPS" sections in the "Apache and nginx settings" icon in the webspace control panel:

If you are using the PHP-FPM interface (recommended):



SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000

(Replace „example.com“ by your domain name.)

If you are using the PHP-FastCGI interface:



SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .htm
Options +ExecCGI
allow from all



SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
Options +ExecCGI
allow from all

After the change, it may take up to 15 minutes for the web server to apply the updated configuration.

Should you not be able to carry out these changes yourself due to lack of permissions, Bitpalace Support will gladly run them for you free of charge in a timely manner. Please send us an e-mail request.

 

Overview of frequently asked questions 

 

 

 


 

Additional Services

Starter Server: Affordable web server from  6.14 NZ$ () /month with PHP, database and many more 

Online Reservation System: Occupancy & vacancy schedule for any ressources (vehicles, sports facilities …) & guest houses, holiday apartments …  14.64 NZ$ () /month 

Software development: Development of database applications, programming and revision of computer programs & scripts  72.47 NZ$ () /hour 

 

FAQ – frequently asked questions 

 

Kiribati

Austria

Canada

Guinea

Palau

Colombia

Cuba

Antigua and Barbuda

Papua New Guinea

Paraguay

Jordan

Argentina

Costa Rica

Australia

Germany

Bahamas

Lesotho

Barbados

Belize

Peru

Uganda

Honduras

Philippines

Madagascar

Bolivia

Botswana

Malawi

Chile

Puerto Rico

India

Malta

Rwanda

Saint Kitts and Nevis

Saint Vincent and the Grenadines

Saint Lucia

Marshall Islands

Zambia

Samoa

Jamaica

Mauritius

Switzerland

Dominican Republic

Liberia

Seychelles

Mexico

Dominican Republic

Micronesia, Federated States of

Sierra Leone

Namibia

Ecuador

Singapore

El Salvador

Fiji

Solomon Islands

Gambia

Spain

Nauru

Sudan

Nicaragua

Swaziland

South Africa

Nigeria

Pakistan

Tanzania, United Republic of

Kenya

Ghana

Tonga

Trinidad and Tobago

Guyana

Tuvalu

Uruguay

Panama

Venezuela

United States

Ireland

Cameroon

Grenada

Guatemala

United Kingdom

Zimbabwe

 

"Cheap Web Space": Affordable web space, cheap web server, low-cost webserver, low-price web servers: fast web server / small web server (cheap web space). Web server for private homepages / small website projects.

  from New Zealand: +49 30 32 70 18 92 •  GmbH, Sensburger Allee 27, D-14055 Berlin (Germany)
Your purchase is tax-free, because you order from a non-EU country. © 2024  GmbH. All rights reserved. and the logo are registered trademarks of GmbH. For photo credits see imprint.

Imprint Privacy policy Sitemap