1 打開PHP工具箱
image.png
2 在E盤創建以下目錄 E:\php
image.png
3 配置host文件
image.png
image.png
在php文件夾中建立 demo1.php 文件
- demo1.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>php.cn</title>
</head>
<body>
<?php
echo '<h2>PHP歡迎學習</h2>';
?>
</body>
</html>
4 然后在瀏覽器輸入 (http://myphpedu.com/demo1.php) 效果如下
image.png
@
(http://myphpedu.com/chapter1/demo1.php)
image.png
image.png