d-_-b
d-_-b

Reputation: 23211

Centos phpmyadmin is not running as PHP script

I installed phpmyadmin on a CentOS server.

When I load view-source:<my-ip>/phpmyadmin in my browser, i see the PHP script, which means it's not being interpreted as PHP.

Does anyone know how/where I would change this?

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Main loader script
 *
 * @package PhpMyAdmin
 */

 etc....

Upvotes: 0

Views: 1589

Answers (3)

SagarG
SagarG

Reputation: 21

Check whether the SELinux on your server is enabled. If enabled, disable it. Even then if you face the same problem, I suggest you to reinstall everything from the scratch. As it looks like a misconfiguration to me.

Upvotes: 1

d-_-b
d-_-b

Reputation: 23211

I had to add the following <Directory> in my httpd.conf file, which tells the server to parse PHP files within the phpMyAdmin directory

<Directory /usr/share/phpMyAdmin>
  Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
  allow from all
  AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
  Require all granted
  AddType application/x-httpd-php .php
  AddHandler fcgid-script .php
  AddHandler fcgid-script .php5
  FCGIWrapper /path/fcgi-bin/php5.fcgi .php
  FCGIWrapper /path/fcgi-bin/php5.fcgi .php5
</Directory>

Upvotes: 1

rleir
rleir

Reputation: 821

When PHP source is not being interpreted as PHP, you need to configure the Apache conf file in /etc/httpd/conf.d/

It needs clauses such as

LoadModule php5_module modules/libphp5.so
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

And restart Apache of course. Would you like to post your conf files?

ref http://php.net/manual/en/install.unix.apache2.php

Upvotes: 3

Related Questions