Page 1 of 1

PHP inside HTML

Posted: Tue Jun 05, 2012 7:52 pm
by scorp
Hello all,
I installed everything to have web server on my RPi including PHP. I can open phpinfo.php file without a problem. But as soon as I include <?php ?> inside index.html(which is my default web page) it is ignored. I checked everything people suggest from Google, but it looks like all fixes already in place. I'm not very good Linux user and PHP/HTML neither, I just want to create my simple page with some data which can be displayed using PHP.

Re: PHP inside HTML

Posted: Wed Jun 06, 2012 12:27 am
by PeteRadford
Hi, unless you specify the .php extention. The PHP processor doesn't know that you are trying to process it. Without the .PHP extention it is passed directly to the web servers default processing method instead. Assuming that you have installed PHP and Apache (or equivalent) correctly. You can rename your index.html or index.htm to index.php and things should all work out for you.

As always always take backups of files before modifying.

Re: PHP inside HTML

Posted: Sun Jun 10, 2012 7:30 pm
by scorp
Thanks. All works now. Had to set also apache2 to open index.php as default page