We help IT Professionals succeed at work.

Hoist the colors! We’ve added location flags to usernames sitewide, so it's easier to connect with the global community on EE. View My Profile

x

PHPMyAdmin showing code instead of webpage

5,190 Views
Last Modified: 2012-08-14
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.
Comment
Watch Question

Garry GlendownConsulting and Network/Security Specialist
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

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:)
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

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

Author

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>

Author

Commented:
Thanks, that worked. I just did not restart the apache server and cleared my browser cache!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.