ASP.NET Web Pages - PHP

PHP Developers Take Note. Web Pages can be written using PHP.

WebMatrix Supports PHP

The first impression of WebMatrix is that it only supports Microsoft technologies. This is not accurate. In WebMatrix, you can write complete PHP applications with MySQL.

Create PHP Site

In the chapter "ASP.NET Web Pages - Create a Website", we created an empty website named "Demo" and created a new empty page of type "CSHTML" within it.

Create an empty site named "Demo_PHP", enable PHP (see the figure below), create a new empty page of PHP type, named "index.php", and you have created your first PHP site.

WebMatrix Enables PHP

Create PHP Page

Write the following code in the file "index.php":

index.php

<!DOCTYPE html>
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>

Run this file to see that PHP is already running.