以下筆記都是按照此博文進行開發學習
一、從github上複製項目到本地
git clone https://github.com/RryLee/StuGradeWithLaravel5.git
二、切換到本地項目目錄下,安裝composer
MacdeMacBook-Pro-3:~ mac$ cd DesktopMacdeMacBook-Pro-3:StuGradeWithLaravel5 mac$ curl -sS https://getcomposer.org/installer | phpAll settings correct for using ComposerDownloading 1.0.1...Composer successfully installed to: /Users/mac/Desktop/StuGradeWithLaravel5/composer.pharUse it: php composer.phar
// 可以將上邊的命令放入到 bin目錄下,方便後邊不用每次都輸入上次的命令
MacdeMacBook-Pro-3:StuGradeWithLaravel5 mac$ sudo mv composer.phar /usr/bin/composerMacdeMacBook-Pro-3:StuGradeWithLaravel5 mac$
// 更新composer
MacdeMacBook-Pro-3:StuGradeWithLaravel5 mac$ composer update
更新出現這樣的問題,-_-!!!
MacdeMacBook-Pro-3:StuGradeWithLaravel5 mac$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
解決方案:
看起來是php沒有開啟mcrypt擴充,我的是沒有開啟mbstring擴充。。。
你看看你的php.ini裡面有沒有這個擴充,把前面的;號去掉然後重啟apache唄
或者
要裝PHP擴充包 mcrypt
在maxos 上可以打 brew install php-mcrypt
運行“sudo cp /etc/php.ini.default /etc/php.ini”,這樣就可以通過php.ini來配置各種PHP功能了
;通過下面兩項來調整PHP提交檔案的最大值,比如phpMyAdmin中匯入資料的最大值
upload_max_filesize = 2M
post_max_size = 8M
;比如通過display_errors來控制是否顯示PHP程式的報錯
display_errors = Off
運行“sudo apachectl restart”,重啟Apache,這樣PHP就可以用了。
解決方案:
vim /etc/php.ini
檔案末尾追加一句
extension=mcrypt.so
最後執行成功的兩段代碼:
MacdeMacBook-Pro-3:apache2 mac$ brew install mcrypt
MacdeMacBook-Pro-3:apache2 mac$ export PATH=/usr/local/php5/bin:$PATH
案頭進入:
MacdeMacBook-Pro-3:~ mac$ cd Desktop/StuGrade
MacdeMacBook-Pro-3:StuGrade mac$