PHP pages are not parsed by Apache on CentOS

Posted by Ram on Server Fault See other posts from Server Fault or by Ram
Published on 2012-08-31T05:03:42Z Indexed on 2012/08/31 9:40 UTC
Read the original article Hit count: 198

Filed under:
|

I have installed Centos 5.x, Apache 2.2, PHP 5.3 and MySQL 5.5. I also installed phpMyAdmin. I am able to access phpMyAdmin through the browser without any issues. However, when I create a simple index.php with phpinfo() function in the default directory, that page is served without php parsing.

As we all know, phpMyAdmin is a php application. This is working fine from the same server but not the simple php page from the doc root directory ??!!!. Of course, I tried moving this page into phpMyAdmin folder and tried accessing it, but no success.

Please note that I updated httpd.conf file with appropriate directives based on the php installation guide.Following directives were added to httpd.conf.

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

File locations are:

  • docroot - /var/www/html
  • phpMyAdmin folder - /var/www/html/phpMyAdmin

File privileges are:

[root@linuxdev1 html]# ls -Z 
-rwxr-xr-x root root index.php 
drwxr-xr-x root root phpMyAdmin 
-rw-r--r-- root root phpMyAdmin-3.4.3.2-english.tar.gz 
drwxr-xr-x root root test1

Any help is appreciated.

© Server Fault or respective owner

PHP pages are not parsed by Apache on CentOS

Posted by infotoknowledge on Super User See other posts from Super User or by infotoknowledge
Published on 2012-08-31T05:57:33Z Indexed on 2012/08/31 9:41 UTC
Read the original article Hit count: 198

Filed under:
|

I have installed Centos 5.x, Apache 2.2, PHP 5.3 and MySQL 5.5. I also installed phpMyAdmin. I am able to access phpMyAdmin through the browser without any issues. However, when I create a simple index.php with phpinfo() function in the default directory, that page is served without php parsing.

As we all know, phpMyAdmin is a php application. This is working fine from the same server but not the simple php page from the doc root directory ??!!!. Of course, I tried moving this page into phpMyAdmin folder and tried accessing it, but no success.

Please note that I updated httpd.conf file with appropriate directives based on the php installation guide.

docroot - /var/www/html
phpMyAdmin folder - /var/www/html/phpMyAdmin

Any help is appreciated.

© Super User or respective owner

Related posts about apache2

Related posts about php