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

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

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

 

FAQ – frequently asked questions 

 

Cuba

Austria

Kenya

Guinea

Panama

Lesotho

Liberia

Antigua and Barbuda

Paraguay

Peru

Cameroon

Argentina

Costa Rica

Australia

Germany

Bahamas

Madagascar

Barbados

Belize

Philippines

Uganda

Honduras

Puerto Rico

Malta

Bolivia

Botswana

Marshall Islands

Chile

Rwanda

India

Mauritius

Saint Kitts and Nevis

Saint Vincent and the Grenadines

Saint Lucia

Mexico

Zambia

Samoa

Jamaica

Micronesia, Federated States of

Switzerland

Dominican Republic

Malawi

Seychelles

Namibia

Kiribati

Dominican Republic

Nauru

Sierra Leone

New Zealand

Ecuador

Singapore

El Salvador

Fiji

Solomon Islands

Gambia

Spain

Nicaragua

Sudan

Nigeria

Swaziland

South Africa

Pakistan

Palau

Tanzania, United Republic of

Colombia

Ghana

Tonga

Trinidad and Tobago

Guyana

Tuvalu

Uruguay

Papua New Guinea

Venezuela

United States

Ireland

Canada

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 Jordan: +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