文档介绍:Eg1
<html>
<head>
<title>HELLO WORLD! </title>
</head>
<body>
<!—以上为普通html代码,以下为php代码-->
<?
echo “HELLO WORLD!”;
?>
<!—以上为php代码-->
</body>
</html>
第2章PHP环境搭配设置
下载Apache
安装成功后
首先进入/
包至C盘,-mended(带附加安全措施)-dist(用于开发)2个文件,这2个文件具有相同的配置值,-
2配置路径
:将C:\、:\windows中
C:\php\、:\WINDOWS\system32
重启Apache服务器。
打开D:\Program Files\Apache Software Foundation\\,定位如下代码,为的是能把PHP文件识别为需要用PHP引擎来解析。
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers press
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding press .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above mented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/press .Z
AddType application/x-gzip .gz .tgz
然后添加如下代码:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php
# For PHP 4
Action application/x-httpd-php "/php/"
# For PHP 5
Action applicat