Apache : php page not loading properly


I tried to host my customer php application on my server. Its a standalone machine and doesn’t have any control panel system installed on it

I hosted the application on CentOS 6 with apache [ Apache/2.2.15 ] and php [ php-5.3.3-48.el6_8].

Default php.conf entry:

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so

# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php

# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php

# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
AddType application/x-httpd-php-source .phps

After host the site in the server, I access it in browser. But it shows 500 internal server error. the log says "PHP Parse error: syntax error, unexpected T_INCLUDE ".

Troubleshooting steps:

  1. ) I did some changes on the php.conf file by replacing Handler values
    From : AddHandler php5-script .php
    To : AddHandler php5-script .php5
    Then , the above include error gone [ 500 Error] from the server. Though, still part of the site contents are not loading.

    Some page shows php code snippet on the browser. Below the code snip shown on browser window.

" 0) { //$s = 0; while($row = dbFetchAssoc($result)) { extract($row); // $id=$row['id']; echo $row['content']; } ?>"

Someone please help me the exact php.conf file entry and also whats the resolution to solve the above error message.

Thanks in advance.


Any idea on this ?. Since I’m still unable to find the resolution to solve the problem.



After long time, I’ve logged into techmint, anyway give me below info to fix the issue.

  1. where you’ve installed php ? pwd
  2. If possible share me your complete httpd.conf file.