:::

3-1 佈署到主機上

一、Apache的設定

  1. Apache 版本需要 2.4 以上
  2. 確認設定檔(如:\xampp\apache\conf\httpd.conf) 中的設定
    1. 確認底下module有啟動(前面無#註解符號):
      • mod_authz_host
      • mod_rewrite
    2. DocumentRoot 請設定至專案的 public 目錄,如:/安裝路徑/xampp/htdocs/exam56/public (若不打算變更的話,屆時只要在瀏覽器上輸入 http://localhost/exam56/public/ 亦可)
    3. 接著找到網頁目錄的部份,將:
      Options Indexes FollowSymLinks Includes ExecCGI

      改為

      Options Indexes FollowSymLinks MultiViews Includes ExecCGI
    4. 例如:
      DocumentRoot "/Users/tad/Dropbox/xampp/htdocs/exam56/public"
      <Directory "/Users/tad/Dropbox/xampp/htdocs/exam56/public">
          #
          # Possible values for the Options directive are "None", "All",
          # or any combination of:
          #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
          #
          # Note that "MultiViews" must be named *explicitly* --- "Options All"
          # doesn't give it to you.
          #
          # The Options directive is both complicated and important.  Please see
          # http://httpd.apache.org/docs/2.4/mod/core.html#options
          # for more information.
          #
          Options Indexes FollowSymLinks MultiViews Includes ExecCGI
      
          #
          # AllowOverride controls what directives may be placed in .htaccess files.
          # It can be "All", "None", or any combination of the keywords:
          #   AllowOverride FileInfo AuthConfig Limit
          #
          AllowOverride All
      
          #
          # Controls who can get stuff from this server.
          #
          Require all granted
      </Directory>
    5. MultiViews的作用是當訪問到目錄中不存在的檔案時( 如訪問http://localhost/test/target), 則apache會尋找該目錄下的所有target.*檔案。如果test目錄下存在target.jpg檔案, 則會把這個檔案返回給客戶, 而不是直接傳回404錯誤訊息。

二、PHP的設定

  1. 確定 php.ini 中的這幾個延伸件有啟用(基本上最新版的XAMPP都有):
    extension=openssl
    extension=fileinfo
    extension=pdo_mysql
    extension=mbstring

三、修改目錄權限

  1. 底下這幾個目錄需設為777(windows下不用)
    • bootstrap/cache
    • storage
  2. 改完後記得先stop Apache,然後再 start 以重新啟動之,此時,只要在瀏覽器上輸入 http://localhosthttp://exam56.local/ 就可以看見網站了。

四、重設app_key

  1. 若是有出現The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.的訊息,請執行以下指令重設app_key即可
    php artisan key:generate
    php artisan config:clear

     


:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D37%26tbdsn%3D1145

計數器

今天: 728728728
昨天: 3463346334633463
總計: 7668047766804776680477668047766804776680477668047