Heim  >  Artikel  >  Backend-Entwicklung  >  Laravel 5 windows安装使用教程

Laravel 5 windows安装使用教程

WBOY
WBOYOriginal
2016-06-20 12:55:59987Durchsuche

需要PHP版本》=5.4.

都不想安装的可以从https://github.com/overtrue/latest-laravel 这里下载大神整理好的,解压即可使用

首先等安装cpmposer, 提示openssl错误的打开PHP.INI配置文件将extension=php_openssl.dll 前面的注释去掉,大概在第887行。

copmposer安装过程就不说了。

下面开始Laravel 5安装过程,github有下载,这里分享个网盘连接:http://pan.baidu.com/s/1dD50dWH

下载后解压,为了方便你可以解压到网站根目录下。我这里解压到F:/laravel [当然了,这不是我的根目录,需要配置虚拟主机]。

由于众所周知的原因国内安装composer,laravel比较慢,推荐使用镜像安装。

修改laravel目录的composer.json文件

在末尾结束括号前加上:

,	 "repositories": [        {"type": "composer", "url": "http://comproxy.cn/repo/packagist"},        {"packagist": false}    ]

若不能用试试http://pkg.phpcomposer.com/

在文件夹内单击鼠标右键选择安装

几分钟后就安装完成啦!


这时会发现目录下多了个vendor文件夹。

laravel的默认首页是server.php,需要配置下,打开httpd.conf配置文件

找到[大概第249行以下]

<IfModule dir_module>    DirectoryIndex index.html index.php index.htm l.php server.php</IfModule>

加上 server.php重启即可。

试试去浏览器打开http://t.com  试看看, 以你自己的安装为准。


到此为止安装成功了,打开慢的原因是使用了谷歌字体, 可以使用国内CDN,找到F:\laravel\resources\views文件夹,打开welcome.blade.php文件,将第五行改为 

360前端公共库:http://libs.useso.com/

接着去试试写个方法,

找到F:\laravel\app\Http文件夹,打开routes.php,加上

Route::get('hi', function(){	return "hi";});
 'Auth\AuthController',	'password' => 'Auth\PasswordController',]);Route::get('hi', function(){	return "hi";});

打开浏览器输入http://t.com/public/hi

试看看,这就是路由了。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn