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

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

改成DocumentRoot c:/wamp/www/public

例如:

<VirtualHost 192.168.10.223:80>
DocumentRoot "E:\wwwroot\192.168.10.222\jingfu\public"
  <Directory "E:\wwwroot\192.168.10.222\jingfu\public">
  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';

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2022-03-09
  • 2021-07-04
  • 2022-12-23
  • 2021-04-26
  • 2021-04-26
  • 2021-10-16
猜你喜欢
  • 2022-01-06
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案