我用phpStudy搭建thinkphp框架,测试成功。但是我换成网上下载的程序
程序目录如下:
vhosts.conf配置如下:
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\PHPTutorial\WWW\web"//index.php不在public下面,跟public同一目录
ServerName 127.0.0.1
ServerAlias
<Directory "D:\phpStudy\PHPTutorial\WWW\web">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
index.php如下:
<?php
/**
* Copyright @ 2000 shandong yunbaozhibo Co. Ltd.
* All right reserved.
* @author: www.yunbaozhibo.com
* date: 2015-12-22
*/
//定义项目名称和路径
define('APP_NAME', 'Liveshow');
define('APP_PATH', './');
// 加载框架入口文件
require( "./Core/ThinkPHP.php");
?>
在浏览器输入http://localhost/显示:
Hello World
输入127.0.0.1,又出现下面的错误
Parse error: syntax error, unexpected 'define' (T_STRING) in D:\phpStudy\PHPTutorial\WWW\web\index.php on line 9
请问哪里有问题?如果配置没问题,出现后面这样的错误又该怎么解决?请教高手,谢谢!