PHP 小白

Jun 13, 2016 pm 12:26 PM
index module nbsp php

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环境,没必要对单个软件配置。
------解决思路----------------------
推荐慕课网,你搜一下,个人真心喜欢
------解决思路----------------------
楼上好几个版主啊。之前我也是没配置好,还是集成环境好弄

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles