Dianne Siebold Dianne Siebold - 1 year ago 152
Apache Configuration Question

Opening PHP File in Apache 2.4.7 Returns Blank Page and No Errors

I have installed Apache 2.4.7 and PHP 5 on a box running Ubuntu 14.04. I'm able to open FF and browse to

and it shows me the Apache2 default page. This
file is located under
and all is good there.

Following the directions from this site, I created
to test out PHP. That file contains

<? php phpinfo(); ?>

When I open FF and navigate to
, I get a blank screen and no errors in

After much Googling, I'm stumped as to why the HTML file displays but the PHP one doesn't. Is there somewhere I can check for PHP errors? The
contains index.php. Also, I modified the
and set
log_errors = On
. I see no errors in syslog.

The permissions to the
/ directory are:

drwxrwxr-x 2 www-data www-data 4096 Jun 16 13:22

The permissions to the files in that directory are:

-rwxrwxr-x 1 www-data www-data 11510 Jun 15 11:52 index.html
-rwxrwxr-x 1 www-data www-data 21 Jun 16 10:09 info.php

Thanks in advance for any help!

Answer Source

it should be <?php and not <? php... <-- notice the space

Fix your PHP tag and see if you have any errors, I will be more than happy to assist.

you can also add these lines just below you <?php line. which will turn on displaying errors and set error reporting to report ALL errors. This only has to be done if the global PHP configuration is turning off error reporting or the displaying of errors, in your case I would suggest trying those lines to see if any errors display.

ini_set('display_errors', 'On');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download