You need to update the file phpMyAdmin.conf to something like this:
<Directory /usr/share/phpMyAdmin/>
order deny,allow
#deny from all
allow from all
</Directory>
or allow from <your IP address>
if you intend to host this server.
If apache is rendering as text your php file, then apache is not configured to use php.
You need to find your httpd.conf file. Unfortuneately, different installs put this in different locations. Start looking in /etc/httpd directory structure. Other places might be /usr/local/etc/httpd. For the below, I'm going to assume /etc/httpd.
When you find httpd.conf, look for ServerRoot. This may be /etc/httpd. There should be a "modules" directory or symbolic link to a directory.
In this directory should be the php module if it was installed, say libphp5.so. First confirm you have a php module in the "modules" directory.
Next, we need to tell apache to use php.
Apache loads a default config file, httpd.conf, and additional config files typically in "extra" or "conf.d" directories. See if you have any of those, and within those should be a php.conf file.
If there is no php.conf file, that could be your issue. Here's a simple one:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php
What this does is tell apache to load the libphp5.so module, associate the .php extension to it, expect the output of the php script to be html, and if an index.php file exists use it when a user goes to a directory instead of specific url.
Best Answer
The configuration file
/etc/apache2/mods-available/php5.conf
controls which files Apache recognizes as php scripts (based on their extensions).Be default (in PHP 5.3.2), the file contains the following code:
This affects files with the following extensions:
.php
.php3
.phtml
From our discussion in chat, I know that your files have a
html
extension. The server was configured to treat.html
files as php files, but your home computer is not. That leaves you with two options:Rename your
.html
files that contain php code to one of the above extensions.Replace the line
in your
php5.conf
byand reload apache by executing the following command:
In addition to the previously mentioned extensions, the new configuration also affects:
.htm
.html