tp5修改入口文件

方法1 设置虚拟路径 在apache里面 找到 httpd-vhosts.conf

打开并修改 DocumentRoot c:/wamp/www/  这段

改成DocumentRoot c:/wamp/www/public

例如:

<VirtualHost 192.168.10.223:80>
DocumentRoot "E:wwwroot192.168.10.222jingfupublic"
  <Directory "E:wwwroot192.168.10.222jingfupublic">
  DirectoryIndex  index.php index.html
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>




方法2 复制public文件到根目录 修改index.php

将../ 删掉 。复制下面内容即可

// 定义应用目录

define('APP_PATH', __DIR__ . '/application/');

// 定义应用缓存目录

define('RUNTIME_PATH', __DIR__ . '/runtime/');

// 开启调试模式

define('APP_DEBUG', true);

// 加载框架引导文件

require __DIR__ . '/thinkphp/start.php';

原文地址:https://www.cnblogs.com/mengor/p/7525287.html