Skip to content
Advertisement

Local IIS installation doesn’t show phpinfo page

I’ve installed PHP on my windows 10 computer, and started IIS.

But when I browse to http://localhost/phpinfo.hml the page is completely blank.

And if I look at the file view in IIS, it seems that it’s not aware that the file exists.

enter image description here

I’ve verified that the phpinfo.html file is in the right place:

 ls -l C:inetpubwwwrootphpinfo.html


    Directory: C:inetpubwwwroot


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         7/16/2020   8:54 AM             72 phpinfo.html

And has the right contents:

PS C:inetpubwwwroot> cat .phpinfo.html
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

PHP is installed:

php --version
PHP 7.4.1 (cli) (built: Dec 17 2019 19:23:59) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

I gave my windows user full access to that directory. What am I doing wrong? How can I get this working?

Advertisement

Answer

If you want to show phpinfo page, you need to change phpinfo.html to phpinfo.php.

And you also need to handle PHP requests by using IIS Manager, you can set this in Handler Mappings.

enter image description here

More information about how to configure IIS to Handle PHP Requests you can refer to this link: Configure IIS to Handle PHP Requests

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement