PHP 小白

WBOY
Release: 2016-06-13 12:26:42
Original
1162 people have browsed it

PHP 小白求助
本人完全PHP小白,通过在网上看资料发现 PHP语法也挺简单,于是抱着学习的心态 想学学PHP。不过万事开头难,现在连个基本的 echo都难实现。 具体问题就是   我apache服务器已经可以成功运行(没有使用IIS),httpd.conf 文件该配置的东西也都配置了,但是 在IE 中浏览index.php 的时候 依旧 出现的是源码!! 网上查资料 说是 apache 服务还是没有配置好,浏览php文件 完全没有通过 服务,, 特地请教 高手  给出点意见,看看出现这种情况 有几种可能? 
1:conf中的PHP路径问题,这是  上的部分。
#LoadModule php5_module "D:\Program Files (x86)\PHP\php5apache2_2.dll"
#PHPIniDir "D:\Program Files (x86)\PHP"
#AddType application/x-httpd-php .php .html .htm
  和 正斜杠、反斜杠 有关系??


2:默认的文档目录
DocumentRoot "D:/htdocs"
完全在D盘新建。  这个Directory 节点的:

3:起始页配置。

    DirectoryIndex index.php index.html

在D:/htdocs 中新建index.php ,代码很简单:

<?php<br />   echo "我的第一段 PHP 脚本!";<br />?>
Copy after login


还请高手多多指教,感兴趣的回答一下,不感兴趣的可以忽略。
------解决思路----------------------
初学用wamp包编程比较方便  下载集成环境吧
------解决思路----------------------
你在访问 index.php 时是如何写地址的?
如果服务器不支持 php,浏览器应出现文件下载,而不是源码

#LoadModule php5_module "D:\Program Files (x86)\PHP\php5apache2_2.dll"
#PHPIniDir "D:\Program Files (x86)\PHP"
#AddType application/x-httpd-php .php .html .htm
前的 # 应删去

------解决思路----------------------
你访问index.php 是如何访问的?
------解决思路----------------------
1楼说的对,用那个wamp
------解决思路----------------------
域名是否设置过了?访问该index.php时的URL是怎么写的?初学建议使用wamp集成环境。
------解决思路----------------------
建议使用wamp搭建。

你运行出现源码,那表示php没有安装好了。
------解决思路----------------------
装个wamp环境,没必要对单个软件配置。
------解决思路----------------------
推荐慕课网,你搜一下,个人真心喜欢
------解决思路----------------------
楼上好几个版主啊。之前我也是没配置好,还是集成环境好弄

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!