PHPMyAdmin showing code instead of webpage

I had installed PHPMyAdmin a few weeks ago on a Mac mini server running Lion Server. It was working fine before, but now when I try to go to server-name/phpmyadmin in a web browser, it shows the source code from the index.php file. I have tried restarting Apache, but it did not do anything.

I am using PHP 5.3.6 and Apache 2.2.20.
shibumi1224Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Garry GlendownConsulting and Network/Security SpecialistCommented:
Sounds like the PHP module isn't loaded ... check the config of Apache whether it's still in the list of active modules, and check the apache logs whether there are any errors shown ...
shibumi1224Author Commented:
I know it was working before. I did not edit or change anything in the httpd.conf file. I wonder if it has anything to do with the my.cnf or the config.inc.php file? My apache error log shows


[notice] caught SIGTERM, shutting down
[warn] RSA server certificate CommonName (CN) 'my-server.local' does NOT match server name!?
httpd: Could not reliably determine the server's fully qualified domain name, using creative-server.local for ServerName
[notice Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8r DAV/2 configured -- resuming normal operations


I also noticed some errors from last week, which occurred while I was on vacation. Looks like some hacking attempts:

[client 115.146.120.142] File does not exist: /Library/Server/Web/Data/Sites/Default/w00tw00t.at.blackhats.romanian.anti-sec:)
xtermCommented:
The server doesn't just forget how to run PHP, my guess is that it was compromised, and I'd strongly suggest reinstalling.

That being said, to get it working again in the mean time, you likely need to make sure two things are in place:
1)  That the PHP module is being loaded.  Look for something resembling the following in your config:
  LoadModule php5_module modules/libphp5.so
2)  That the file extension .php is known to the web server.  Look for these in your php.conf or httpd.conf:
  AddHandler php5-script .php
  AddType text/html .php

Keep in mind that both of these will need to be present for Apache to treat the file as PHP code rather than vanilla HTML.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

shibumi1224Author Commented:
I found the line "#LoadModule php5_module libexec/apache2/libphp5.so" in my httpd.conf and uncommented it. My php5.conf had this in it:

<IfModule php5_module>
     AddType application/x-httpd-php .php
     AddType application/x-httpd-php-source .phps

     <IfModule dir_module>
          DirectoryIndex index.html index.php
     </IfModule>
</IfModule>

Where would I add in these two lines? In the httpd.conf file?
  AddHandler php5-script .php
  AddType text/html .php
shibumi1224Author Commented:
I also found this in my httpd.conf


<IfModule php5_module>
     AddType application/x-httpd-php .php
     AddType application/x-httpd-php-source .phps

     <IfModule dir_module>
          DirectoryIndex index.html index.php
     </IfModule>
</IfModule>
shibumi1224Author Commented:
Thanks, that worked. I just did not restart the apache server and cleared my browser cache!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.