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!

 in the United States (Chicago, IL): 1 (815) 526-7037, Fax (in Germany) +49 30 32 70 18 91

service@bitpalace.com 

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  3.73 US$ () /month with PHP, database and many more 

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

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

 

FAQ – frequently asked questions 

 

Kiribati

Austria

Cameroon

Guinea

Pakistan

Colombia

Cuba

Antigua and Barbuda

Panama

Papua New Guinea

Jordan

Argentina

Costa Rica

Australia

Germany

Bahamas

Lesotho

Barbados

Belize

Paraguay

Tuvalu

Honduras

Peru

Madagascar

Bolivia

Botswana

Malawi

Chile

Philippines

India

Malta

Puerto Rico

Rwanda

Saint Kitts and Nevis

Samoa

Marshall Islands

Saint Vincent and the Grenadines

Zambia

Jamaica

Mauritius

Saint Lucia

Dominican Republic

Liberia

Switzerland

Mexico

Canada

Dominican Republic

Micronesia, Federated States of

Seychelles

Namibia

Ecuador

Sierra Leone

El Salvador

Fiji

Singapore

Gambia

Solomon Islands

Nauru

Spain

New Zealand

Sudan

Swaziland

Nicaragua

Nigeria

South Africa

Kenya

Ghana

Tanzania, United Republic of

Tonga

Guyana

Trinidad and Tobago

Uganda

Palau

Uruguay

Venezuela

Ireland

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.

 in the United States (Chicago, IL): 1 (815) 526-7037 •  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