在Windows操作系统中,你可以使用 Composer 的Windows安装工具。
安装过程中需要注意事项:
1.需要支持php5.4以上版本
2.需要开启php目录下的php.ini中extension=php_openssl.dll?前的分号去掉。
3.安装composer.
4.在Github下载最新版本(目前4.1):https://github.com/laravel/laravel/archive/master.zip。
5.?解压到www下?项目目录中。
6。在cmd中进入到项目目录?输入执行命令composer install?进行安装。
7.?安装完毕后,在浏览器中输入localhost://项目名字?进行访问。
8?遇到? Whoops,?looks?like?something?went?wrong.???打开app\config\app.php 修改:‘debug‘ => true。
9.根据显示文件的行数。查找原因。
10.如果遇到openssl_random_pseudo_bytes?报错。那么修改如下:
?
?
?
?
?
?
?
如果 openssl_random_pseudo_bytes 这个方法获取随机数据失败的话(在PHP文档关于这个openssl_random_pseudo_bytes方法的介绍中提示在某些情况下可能执行失败,看来还是比较危险的),直接抛出异常了,这时候网站就报错了,各位同学会不会觉得他们这样做太粗鲁了?
直接替换random?函数
我觉得合适的办法是在?openssl_random_pseudo_bytes 这个方法执行返回 false 的情况下继续执行,通过这个函数的静态方法quickRandom获取,代码如下:
public static function random($length = 16) { if (function_exists(‘openssl_random_pseudo_bytes‘)) { $bytes = openssl_random_pseudo_bytes($length * 2); if ($bytes !== false) { return substr(str_replace(array(‘/‘, ‘+‘, ‘=‘), ‘‘, base64_encode($bytes)), 0, $length); } } return static::quickRandom($length); }
?
?
?
?
?
?
?
原文:http://webkaifazhe.iteye.com/blog/2187314