phpstudy部署thinkPHP


利用phpstudy配置虛擬主機

Listen 8080
<VirtualHost _default_:80>
DocumentRoot "D:\phpStudy\WWW"
  <Directory "D:\phpStudy\WWW">
    Options -Indexes +FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>


<VirtualHost *:8080>
    DocumentRoot "D:\GitHub\TPVueTODO\public"
    ServerName www.todo.com
    ServerAlias todo.com
  <Directory "D:\GitHub\TPVueTODO\public">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  </Directory>
</VirtualHost>

注意是public目錄

url 重寫

但入口文件訪問時url總需要帶上index.php,實際使用中可以使用apace的url重寫模塊完成自動加入index.php。這個需要public下面的.htaccess文件。如果碰到No input file specified.可能需要修改下這個文件:

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

在默認情況下會導致No input file specified. 修改成:

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]


免責聲明!

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



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