|<?php phpinfo(); ?> returns blank when embedded in .html|
| 12:54 pm on Aug 3, 2010 (gmt 0)|
I am configuring a new server with Lighttpd, PHP5 & mysql as on this page:[howtoforge.com ]
Well, i am noob on those things, the problem is that when I test php via a simple index.php page with <?php phpinfo(); ?> in it, everything's ok. But, When I embed that into an .html file as shown below, the page returns blank.
<?php phpinfo(); ?>
what may be the reason for that? I think something is wrong.
p.s.: Using mysql_secure_installation, i have disabled remote connections. What is this for? On 'CentOS perfect setup' pages, everyone recommends setting:
mysqladmin -h server.example.com -u root password yourrootpassword
do I really have to set this?
| 2:18 pm on Aug 3, 2010 (gmt 0)|
Hi there teasers,
When I embed that into an .html file as shown below, the page returns blank.
It will, you need the file type to be .php otherwise the parser won't be invoked to do it's job - you can however do something with apache that tells it to use the php parser on .html files too, though I haven't done this before.
| 5:37 pm on Aug 3, 2010 (gmt 0)|
So I think the above example, which puts php into html is a wrong example as performing a test -- unless 'do something with apache that tells it to use the php parser on .html files too' as you said.
| 7:08 pm on Aug 3, 2010 (gmt 0)|
No, you can put PHP inline in HTML - you must simply name the file with a PHP extension. test.html = test.php.
| 7:35 am on Aug 4, 2010 (gmt 0)|
You can use .htaccess file in the directory to tell apache about that, its a 1 line command.
AddType application/x-httpd-php .html
| 9:08 am on Aug 4, 2010 (gmt 0)|
and.. if the server is Lighttpd? Same?
| 11:45 am on Aug 5, 2010 (gmt 0)|
You'll want to get familiar with the configuration directives [redmine.lighttpd.net] for that http server.