1. 程式人生 > >[Laravel 5.2]一、安裝與環境配置

[Laravel 5.2]一、安裝與環境配置

1.安裝wamp //注意版本限制 其中PHP在5.5以上 laravel 需要用到其中特性

2 安裝composer

3安裝larvel

4設定apache 

1)在E:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conof

<pre name="code" class="plain"><VirtualHost *:80>
DocumentRoot "E:\wamp\www\project\public"
ServerName laravel.dev
ErrorLog "logs/laravel.log"
CustomLog "logs/laravel.log" common
</VirtualHost>

2) httpd.conf 把虛擬主機啟動

# Virtual hosts#Include conf/extra/httpd-vhosts.conf

把第二個# 也就是Include 前面的#去掉

3)改host  路徑C:\Windows\System32\drivers\etc\host

127.0.0.1       laravel.dev

ps:如果更改host 沒有許可權,就用管理員許可權啟動記事本,然後開啟host修改


4)開啟   laravel.dev
出現歡迎頁面



5)可能會出現  laravel.dev可以執行,但是laravel.dev/about 出現404報錯

這時 修改 httpd.conf

<Directory "D:\WAMP\laravel\public">
    Options Indexes FollowSymLinks
    #

    # AllowOverride controls what directives may be placed in .htaccess files.

    # It can be "All", "None", or any combination of the keywords:

    #   Options FileInfo AuthConfig Limit

    #此處必須為all none不行

    AllowOverride All
    #

    # Controls who can get stuff from this server.

    #

    #Require all granted

    #Allow Order not supported

    Allow from all 

    Require all granted 

</Directory>