官方文档地址:http://www.golaravel.com/docs/4.1/introduction/
系统环境 Mac OSX 10.9.2
升级php
- brew update
- brew upgrade
- brew tap homebrew/dupes
- brew tap josegonzalez/homebrew-php
- brew install php55
-
复制代码
安装composer
- https://getcomposer.org/doc/00-intro.md#globally-on-osx-via-homebrew-
-
复制代码
安装php55-mcrypt
(启动后访问路由地址,如果提示 Mcrypt PHP extension required)
- 1.Mac brew install php55-mcrypt
-
- 2.XAMPP 我没遇到那个提示,一切正常。php -i | grep mcrypt 显示为enabled
-
复制代码
配置php.ini
- extension=php_openssl.dll
-
复制代码
创建一个新项目
- composer create-project laravel/laravel demo
-
复制代码
配置 /etc/hosts个人喜好)
- 127.0.0.1 localhost
- 127.0.0.1 laravel.dev
-
复制代码
配置 /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
- ServerAdmin qbylucky@gmail.com
- DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/demo/public"
- ServerName laravel.dev
- ServerAlias laravel.dev
- ErrorLog "logs/qbylucky@gmail.com-error_log"
- CustomLog "logs/qbylucky@gmail.com-access_log" common
-
复制代码
启动项目
开启 XAMPP apache 服务器 http://laravel.dev/
知识点
- php的位置:
- 1.Mac /usr/bin/php
- 2.XAMPP /Applications/XAMPP/xamppfiles/bin/php
-
- php.ini的位置:
- 1.Mac /etc/php.ini
- 2.XAMPP /Applications/XAMPP/xamppfiles/etc/php.ini
-
复制代码
|