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.
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:
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:
If you have any further questions, feel free to post them below.
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.