My sysadmin setup a virtual server using CentOS, PHP and Apache.
All seems correctly installed: I get the Apache welcome page, I can find PHP using which php
as well as yum list installed *php*
.
I can also put a file testing1.html
in /var/www/html/ and see html content on a browser.
But when creating a file testing2.php
containing <? phpinfo(); ?>
I try to access it via browser and get a blank page.
The Apache log says
[23/Oct/2015:09:27:13 -0400] "GET /testing2.php HTTP/1.1" 200 16 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
which doesn't really help me figure out what's wrong.
Folder permissions are 755 and file permissions are 644.
Any suggestions on how to begin troubleshooting this?
Best Answer
Looking at the contents of the test PHP file (
<? phpinfo(); ?>
) I suspect that yourphp.ini
doesn't have short-open-tag enabled.To fix this, you have two options.
Change the contents of your code to:
<?php phpinfo(); ?>
Enable
short-open-tag
in php.ini.The preferred approach would be the first, in accrodance with PHP: