Re: Forum displays PHP code, not website [message #177374 is a reply to message #177372] |
Thu, 22 March 2012 09:29 |
M. Strobel
Messages: 386 Registered: December 2011
Karma:
|
Senior Member |
|
|
Am 22.03.2012 04:20, schrieb P E Schoen:
> "Dave Pyles" wrote in message news:jkdv3n$s61$1(at)dont-email(dot)me...
>
>> P E Schoen wrote:
>>> Last night I wanted to check out a forum http://www.mytractorforum.com/,
>>> but instead of showing the forum, it displays the PHP code. I thought it
>>> was a temporary glitch, but it's going on almost 24 hours now. I don't
>>> really know how to contact them. But I'm wondering what may have
>>> happened. Hacked?
>>>
>>> Thanks,
>
>> Seems to be working correctly now.
>
> I tried again, and still saw the problem, but it was reloading the page from the
> cache. A refresh cleared it up. I still wonder what could have caused the source to
> be displayed. Would this happen if the PHP application on the server was missing or
> defective?
>
> Thanks,
>
> Paul
Even with a correctly installed and "working" PHP the web server will show you the
source code if (Apache on Ubuntu) file /etc/apache2/mods-available/php5.conf is not
linked into mods-enabled/!
php5.conf:
<IfModule mod_php5.c>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine Off
</Directory>
</IfModule>
</IfModule>
/Str.
|
|
|