Am using CentOS 7 Latest Version.

I already enabled httpd service and it's working file.

i did installed php and my issue started once i add php file to /var/www/html/

for example : test.php

now once i open server ip x.x.x.x/test.php ... i do see blank page?

what shall i do in that case??

php already installed !

httpd working fine but doesn't load php files !

  • Well, it is a good thing that you see a blank page. If the page was not working you would get some HTTP error. Seriously, you did not ever tell us what you mean by "i open server" (you mean you go into the server room and open the cover?) – grochmal May 22 '17 at 3:00
  • Have you install mod_php? – Romeo Ninov May 22 '17 at 5:52
  • 1
    Look at apache error log. – Luciano Andress Martini Sep 17 '18 at 20:52
  • I'm voting to close this question because it seems to be abandoned by the asker, and is over a year old, so is likely obsolete to the asker. – Tim Kennedy Sep 18 '18 at 13:19

Your question is a bit oddly phrased but as far as I can tell... you did not make the home page file an index.php file if you don't already have a file named that in the folder no file will load.

  • well, i created index.php file with code of <?php phpinfo(); ?> under /var/www/html/ but it's keep showing blank page once loaded ! – αԋɱҽԃ αмєяιcαη May 22 '17 at 2:29
  • First make sure the ip address is the correct address and secondly, if that does not work, try reinstalling the Apache server because the steps may have been messed up in the process and make sure you get the steps from a reliable source as many are often outdated. – Max May 22 '17 at 2:59

in /etc/httpd/conf/httpd.conf I added:

LoadModule php5_module "/usr/lib64/php"

AddType application/x-httpd-php .php

and found: DirectoryIndex index.html then add index.php

I also uncommitted include_path='.:/php/includes' in /etc/php.ini

Then, yum install php php-pear

Also changed ServerName in conf to localhost:80 and it works!

Now php working fine with httpd

Not the answer you're looking for? Browse other questions tagged or ask your own question.