Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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>
<p>
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>
<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>
<p>If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
</p>
</td></tr>
</table><br />
</div></body></html>

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
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? –  FEichinger Dec 21 '12 at 22:11
add comment

1 Answer 1

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"
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
add comment

Your Answer

 
discard

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.