Performance of PHP scripts in the html files

Asked by:
onlin164 / 64 Points
Time:
2013-08-30 2:17 am EST
Category:
Htaccess
Hits:
1,049
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.

ANSWERS

0

arnelc
Staff
17,314 Points
2013-08-30 3:25 am 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.

Regards,
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.
onlin164
64 Points

2013-08-31 6:27 pm 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!

Regards,
Arnel C.

arnelc
17,314 Points
Staff
2013-09-04 12:15 am 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.
onlin164
64 Points

2013-09-04 2:42 pm EST
Want to share this Question?

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!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com 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.
}