Performance of PHP scripts in the html files

Asked by:
onlin164 / 64 Points
Time:
2013-09-02 6:25 pm EST
Category:
Htaccess
Hits:
311
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
Will it be attained my goal?

… 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.

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

To submit an answer, please login.

ANSWERS

0

johnpaulb-whh2
Staff
12,339 Points
2013-09-03 3:47 pm EST
Hello Vsevolod,

Thank you for your question. Below is a basic example of a php script that runs, you may have to rename your .htaccess file (something like .htaccess.old), so the changes you made there will not affect the script.

How to create a basic php script (hello world) that runs:
This can be done by simply creating a file, and putting the script in the text.

For example if you create a file in your public_html folder called:
example.php

In the body of the file I entered:
< ? php
echo "Hello World";
?>


Now, you will see Hello World, when you navigate to the file via this address:

domain.com/example.php

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

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

Dear John-Paul!

Thanks for help!
Changing the name of the file. Htaccess give result - simple few small PHP scripts performed 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:41 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.
}