scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

PHP inside HTML

Tue Jun 05, 2012 7:52 pm

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

PeteRadford
Posts: 1
Joined: Wed Jun 06, 2012 12:24 am

Re: PHP inside HTML

Wed Jun 06, 2012 12:27 am

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.

scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

Re: PHP inside HTML

Sun Jun 10, 2012 7:30 pm

Thanks. All works now. Had to set also apache2 to open index.php as default page

Return to “Other programming languages”