Link to home
Start Free TrialLog in
Avatar of Dima Iva
Dima Iva

asked on

Blank page instead of info.php output in Apache on Windows

I installed Apache 2.4.37 Win64 VC15 and PHP 7.2.11 on Window 2016.  Microsoft Visual C++ 2015 Redistributable (X64).  Set up Apache, so when I go to locahost, it shows "It Works!".  However, after placing info.php with <?php phpinfo(); ?> and trying to open it, I have a blank page.

In httpd.conf, I added:
LoadModule php7_module "c:/php/php7apache2_4.dll"

<IfModule php7_module>
      AddHandler application/x-httpd-php .php
      AddType application/x-httpd-php .php .html
    PHPIniDir "c:/php"

</IfModule>

Also added to httpd.conf :

DirectoryIndex index.html index.php

In php.ini added:

extension_dir = "ext"

There C:\PHP\logs directory I created is empty.  Apache error.log shows this after each restart, but nothing else:

[Sun Oct 28 16:54:29.152004 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Oct 28 16:54:31.199280 2018] [mpm_winnt:notice] [pid 4156:tid 508] AH00364: Child: All worker threads have exited.
[Sun Oct 28 16:54:31.230224 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00430: Parent: Child process 4156 exited successfully.
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00455: Apache/2.4.37 (Win64) PHP/7.2.11 configured -- resuming normal operations
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00456: Apache Lounge VC15 Server built: Oct 18 2018 17:26:33
[Sun Oct 28 16:54:34.120902 2018] [core:notice] [pid 2220:tid 580] AH00094: Command line: 'c:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Sun Oct 28 16:54:34.136298 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00418: Parent: Created child process 292
[Sun Oct 28 16:54:34.433217 2018] [mpm_winnt:notice] [pid 292:tid 508] AH00354: Child: Starting 64 worker threads.

What could I try?
Avatar of arnold
arnold
Flag of United States of America image

Try
<?
Phpinfo();
?>

Instead of what you have.

Not sure the extra php is needed there.
Also make sure you restart the Apache service to make sure the change you made are in effect.
Seems like you may be running FPM (insufficient info) + if you are, the both Apache + FPM seem to be starting.

Likely the communication path between Apache + FPM is misconfigured.

Since you're using Windows (shudder) there is no packaged solution, like a Linux Distro which is install + everything just works...

Instead you'll have to find a guide showing how to setup Apache with either embedded PHP or FPM.

Keep in mind mod_event + FPM is required for HTTP2 support.
Go and get the MS web plattform installer and reinstall Apache and PHP. I had the same problems some time ago. It might be a misconfiguration. If php-logging is turned "ON" in php.ini and you don't get any errors it turns out to be crucial to troubleshoot it.
ASKER CERTIFIED SOLUTION
Avatar of Dima Iva
Dima Iva

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial