当前位置:Gxlcms > PHP教程 > Laravel初次体验

Laravel初次体验

时间:2021-07-01 10:21:17 帮助过:21人阅读

官方文档地址:http://www.golaravel.com/docs/4.1/introduction/

系统环境 Mac OSX 10.9.2

升级php
  1. brew update
  2. brew upgrade
  3. brew tap homebrew/dupes
  4. brew tap josegonzalez/homebrew-php
  5. brew install php55
安装composer
  1. https://getcomposer.org/doc/00-intro.md#globally-on-osx-via-homebrew-
安装php55-mcrypt

(启动后访问路由地址,如果提示 Mcrypt PHP extension required)

  1. 1.Mac brew install php55-mcrypt
  2. 2.XAMPP 我没遇到那个提示,一切正常。php -i | grep mcrypt 显示为enabled
配置php.ini
  1. extension=php_openssl.dll
创建一个新项目
  1. composer create-project laravel/laravel demo
配置 /etc/hosts个人喜好)
  1. 127.0.0.1 localhost
  2. 127.0.0.1 laravel.dev
配置 /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
  1. ServerAdmin qbylucky@gmail.com
  2. DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/demo/public"
  3. ServerName laravel.dev
  4. ServerAlias laravel.dev
  5. ErrorLog "logs/qbylucky@gmail.com-error_log"
  6. CustomLog "logs/qbylucky@gmail.com-access_log" common
启动项目

开启 XAMPP apache 服务器
http://laravel.dev/

知识点
  1. php的位置:
  2. 1.Mac /usr/bin/php
  3. 2.XAMPP /Applications/XAMPP/xamppfiles/bin/php
  4. php.ini的位置:
  5. 1.Mac /etc/php.ini
  6. 2.XAMPP /Applications/XAMPP/xamppfiles/etc/php.ini
Laravel

人气教程排行