1

In my centos:

php -v works gives 5.4 version

the httpd server is running and working

AddType application/x-httpd-php .php

this line of code is in httpd.conf, why the index.php file isn't hanled?

is there anyway that I can check if its all ok?

output of rpm -qa | grep php:

php54-pdo-5.4.26-1.ius.el6.x86_64
php54-mbstring-5.4.26-1.ius.el6.x86_64
php54-common-5.4.26-1.ius.el6.x86_64
php54-mysql-5.4.26-1.ius.el6.x86_64
php54-ldap-5.4.26-1.ius.el6.x86_64
php54-gd-5.4.26-1.ius.el6.x86_64
php54-mcrypt-5.4.26-1.ius.el6.x86_64

also I get this error after sudo yum install php -y:

--> Finished Dependency Resolution
Error: Package: php-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: php-cli-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: php-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: php-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: php-cli-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
Error: Package: php-cli-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: php-cli-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: php-5.4.26-32.el6.art.x86_64 (atomic)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

1 Answer 1

2

First insure that you have the PHP Apache module installed.

ls -l /etc/httpd/conf.d/php.conf

If you don't have that file then you may just have the php-cli (command line interface) installed without the php Apache httpd module. To install run the command:

sudo yum install php -y

Then restart your httpd server:

sudo service httpd restart

For Apache httpd to process index.php files, you need to update your DirectoryIndex to handle PHP directory indexes.

On Centos edit the file:

/etc/httpd/conf/httpd.conf

Search for the line starting:

DirectoryIndex

And add the following to the space delimited list of index filenames:

index.php

Directory index files will be recognized in the order they are defined.

You will also need to restart your httpd service using:

sudo service httpd reload

Alternatively you can use the apachectl utility to reload httpd gracefully

sudo apachectl graceful
Sign up to request clarification or add additional context in comments.

11 Comments

I've did what you've sayd and restarted the server, but the index.php still isn't handled, cant figure out why is that
How about if you call it directly by adding index.php to the URL?
yes thats what I've did, it gives me text of the php code in my browser
I have revised the Answer, make sure the 'php' module is installed and not just the 'php-cli' command line interface.
added output in my question
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.