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 license@php.net.
</table><br />

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

Can someone tell me what's wrong?

  • 1
    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

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
; http://php.net/default-mimetype
default_mimetype = "text/html"
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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