30天API學習日誌 - 2

Day 2

今天目標在把Laravel上線,決定先使用IP方式直連測試,安裝Laravel的過程中DigitalOcean的5美金專案,其記憶體空間不夠,升至15美金3GB才順利安裝好Laravel,否則composer完全動不起來:(
接下來進行Nginx的連接,設定檔位置deault在 /etc/nginx/sites-enabled/default & /etcnginx/sites-available/default 記得nginx其中進入專案的index.php/index.html檔案位置,不要放在http(linux身分)拜訪不到的資料夾中(例:root資料夾)
nginx找到public/index.php之後讀取的vendor資料夾找不到,才發現在使用指令

1
composer create-project laravel/laravel your-project-name --prefer-dist

創立時發生出錯

1
2
laravel/framework v7.8.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
......

這類缺少PHP元件的問題都會導致laravel創立檔案時失去vendor資料夾,我們把缺的物件(php-mbstring,php-xml)用指令補齊

1
sudo apt-get install php-mbstring & sudo apt-get install php-xml

到這裡已經出現img.1畫面,雖然Database還沒設定好但基本的Laravel資料已可看見,今天就先到這裡。
img.1

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
...
  • Copyrights © 2020 Dante Wu
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信