Performance of PHP scripts in the html files

Asked by:
onlin164 / 64 Points
2013-08-29 7:17 pm EST
Greetings team Web Hosting Hub!

I would like to force the execution of PHP scripts in the html files, so I pointed out directive . htaccess file:
AddHandler application / x-httpd-php. Php. Html. Shtml
Will it be attained my goal?

In advance I thank you for the help me.

Yours faithfully, Vsevolod M.

To ask this user for more information, please first login.

To submit an answer, please login.



9,313 Points
2013-08-29 8:25 pm EST
Hello Vsevolod M.,

Thanks for the question. Forcing the execution of the php scripts should work depending on your code - since you added the add handler. This is also noted here: Stack Overflow - including PHP script in HTML.

Remember that the letters for the extensions in the .htaccess rule should be all in LOWER CASE. It should look like this:

AddHandler application / x-httpd-php. php. html. shtml

The rest of it will depend on your code.

I hope this helps to clarify the issue. Please let us know if you have any further questions or comments.

Arnel C.

To submit a comment on this answer, please first login.

Greetings team Web Hosting Hub!
Dear Arnel C.
I all made as so you said but, unfortunately, nothing not changed.
Moreover even simple few small PHP scripts not performed such as greeting "Hello world!" do not mention more complex scripts.
Several times I checked the work of Php scripts - as a result none of them work.
What is the reason this result?
Furthermore earlier I added in section "Apache Handlers" one of the scripts.
Result is the same.
I also tried to change the file extension from html file on extension .Php.
As a result, with all this page does not open in the browser at all, in turn, the browser starts loading file instead opening it.
What's the matter?

In advance I thank you for the help me.
Yours faithfully, Vsevolod M.
64 Points

2013-08-31 11:27 am EST
Hello Vsevolod M.,

I'm sorry to hear that the script's not working. I decided to test your account and the scripts you're trying with different variations on the Addhandler. I finally tried the following in the .htaccess file:

AddHandler application/x-httpd-php5 .html

When I did that, I was able to run my script, which you can see under "help-test.html" and I was also able to run your script with the file name: "Hello.html".

Check it out and let me know if you have any further questions! Sorry for the troubles!

Arnel C.

9,313 Points
2013-09-03 5:15 pm EST
Dear Arnel C.

Thanks for your assistance!
Changing the name of the file. Htaccess give result -
simple few small PHP scripts performed as suggested by one of your employees, while some more complex scripts not performed due to the some errors.
Now I busy with other matters, therefore come back to this subject a little later.
I wish you all the best.
Yours faithfully, Vsevolod M.
64 Points

2013-09-04 7:42 am EST
Want to share this Question?

News / Announcements

Update to SSL Certificates - Certificate Warnings
1969-12-31 11:00 am EST
Hits: 624
What is the Heartbleed bug?
1969-12-31 11:00 am EST
Hits: 233

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.