Laravel5学生成绩管理系统开发笔记
一、从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$