<?php
// 定义应用目录
define('APP_PATH', __DIR__ . '/Application/');
// 加载框架引导文件
require __DIR__ . '/../ThinkPHP5/thinkphp/start.php';
// 读取自动生成定义文件
$build = include 'build.php';
// 运行自动生成
\think\Build::run($build);build.phpreturn [
// 生成运行时目录
'__file__' => ['common.php'],
// 定义index模块的自动生成
'index' => [
'__file__' => ['common.php'],
'__dir__' => ['behavior', 'controller', 'model', 'view'],
'controller' => ['Index'],
'model' => [],
'view' => ['index/index'],
],
];错误提示[2] ErrorException in App.php line 245
is_file(): open_basedir restriction in effect. File(\runtime\init.php) is not within the allowed path(s): (C:\Inetpub\Temp\;C:\Inetpub\WWWRoot\)
*/
private static function init($module = '')
{
// 定位模块目录
$module = $module ? $module . DS : '';
// 加载初始化文件
if (is_file(APP_PATH . $module . 'init' . EXT)) {
include APP_PATH . $module . 'init' . EXT;
} elseif (is_file(RUNTIME_PATH . $module . 'init' . EXT)) {
include RUNTIME_PATH . $module . 'init' . EXT;
} else {
// 加载模块配置
$config = Config::load(CONF_PATH . $module . 'config' . CONF_EXT);
// 读取数据库配置文件
$filename = CONF_PATH . $module . 'database' . CONF_EXT;
Config::load($filename, 'database');
Call Stack
in App.php line 245
at Error::appError(2, 'is_file(): open_base...', 'C:\Inetpub\WWWRoot\T...', 245, ['module' => ''])
at is_file('\runtime\init.php') in App.php line 245
at App::init() in App.php line 182
at App::initCommon() in App.php line 82
at App::run() in start.php line 19
at require('C:\Inetpub\WWWRoot\T...') in Index.php line 5运行环境:Windows 10 + IIS 10 + FastCGI + PHP 7.2.10ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。