tp5修改入口文件


方法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';


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM