Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed php.5.1.2 on ubuntu server.

I tried to run simple test:

<? phpinfo() ?>

it displayed the information but, also display the html tags:

</table><br />
<h2>PHP License</h2>
<table border="0" cellpadding="3" width="600">
<tr class="v"><td>
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file:  LICENSE
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
<p>If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact
</table><br />

I compiled from source. I did not find a good way to remove it.

Can someone tell me what's wrong?

share|improve this question
How did you do your test? Did you run php from the commandline? – jippie Dec 21 '12 at 21:59
yes php test.php from command – meda Dec 21 '12 at 22:03
Basically looks like you have nothing that converts the HTML - which may be a MIME type error, or simply something improper about how you access the file - could you specify how you get this output? – user98085 Dec 21 '12 at 22:11
up vote 1 down vote accepted

It sounds like the default MIME type is wrong. It's being interpreted as text/plain when it should be interpreted as text/html. I have not compiled from source. From the package(s) I've installed, there's a stanza in the three files /etc/php5/apache2/php.ini, /etc/php5/cgi/php.ini and /etc/php5/cli/php.ini which reads:

PHP's built-in default is text/html
default_mimetype = "text/html"
share|improve this answer
does this affect the way php runs? I am having issue with connections to Database? – meda Dec 21 '12 at 22:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.