如何安装Lavarel How to install Lavarel?

How to install Lavarel? 如何安装Lavarel

中英切换太麻烦了…
  1. install php
    1. config php : rename the php.ini-deveplopment => php.ini
    2. enable the extension in php.ini
      • extension=php_mbstring.dll
      • extension=php_openssl.dll
    3. add php to $path
  2. install composer;

    run the command like these:

    Thanks: https://pkg.phpcomposer.com/#how-to-install-composer

  3. you will get file composer.phar,and then the php composer.phar is just composer; !!look—>:

    php composer.phar -v
    
    .... Some Version description ...
  4. To just use the name of “composer” ,add “composer.phar” to php dir;

    • add file “composer.bat” at php dir ( where there is php.exe);
    • write in “composer.bat” ” :@php "%~dp0composer.phar" %*
  5. install Lavarel :

    1. global install :
      • composer global require "laravel/installer"
    2. 配置环境变量: $YouInstallHome/vendor/bin ( where there is laravel.bat) add to $path;
    3. create Lavarel project :
      • laravel new blog
    4. cd to blog ,and install dependence(use composer.json):
      • composer install
    5. use artisan to init awsome works (you will find file “artisan” after composer install) :
      • php artisan optimize
  6. create Laravel config file “.env”
    1. create new file “.env” from “.env-example”
  7. config for apache

    1. enable the Module rewrite for file ‘.htaccess’
      • LoadModule rewrite_module modules/mod_rewrite.so
    2. set access to /

      <Directory/>
      AllowOverride all
      Require all granted
      </Directory>
    3. set “index.php” as DirectoryIndex:

      <IfModule dir_module>
      DirectoryIndex index.php
      </IfModule>
  8. enable Laravel debug:

    1. open “config/app.php”, set debug from ‘false’ to ‘true’; That’s an amazing debugger!;
      • 'debug' => env('APP_DEBUG', true),
  9. success Page:

    Laravel

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值