phpStudy使用教程

文章目录

      • 1. phpStudy下载
      • 2. 修改端口
      • 3. 运行第一个php程序 hello world

1. phpStudy下载

https://m.xp.cn/

2. 修改端口

phpStudy使用教程_第1张图片

3. 运行第一个php程序 hello world

代码

<!DOCTYPE html>
<html>
<body>


header("content-type:text/html;charset=utf-8");         //设置编码
echo "hello world 我的第一段 PHP 脚本!";
?>  

</body>
</html>

把上面的代码保存为helloworld.php文件,放在phpstudy_proWWW目录中
phpStudy使用教程_第2张图片
确保Apache正常运行
phpStudy使用教程_第3张图片

然后在浏览器输入
http://localhost:8082/helloworld.php
即可看到效果。(注意端口如果你在httpd.conf设置的是别的端口,这里就要使用你设置的端口,默认是80)
phpStudy使用教程_第4张图片

你可能感兴趣的:(php)