码迷,mamicode.com
首页 > 其他好文 > 详细

laravel 安装

时间:2020-04-23 00:21:28      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:download   进入   could not   not   get   could   operation   访问   The   

  • 安装composer.
  • 进入nginx主目录 cd /Applications/MAMP/htdocs/
  • 设置国内镜像,执行 composer config -g repo.packagist composer https://packagist.phpcomposer.com
  • 下载laravel, composer global require "laravel/installer
  • 新建laravel项目composer create-project laravel/laravel ldemo --prefer-dist。安装成功后,看到htdocs目录下有了新目录ldemo。需要看到vendor目录下有了autoload.php才算安装成功。如果看到有报错信息,例如
    - Installing paragonie/random_compat (v9.99.99): Downloading (failed)       
    The "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" file could not be downloaded: failed to open stream: Operation timed out
    Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
    Downloading (failed)       
    Downloading (failed)       
    Downloading (failed)    Failed to download paragonie/random_compat from dist: The "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" file could not be downloaded: failed to open stream: Operation timed out
    Now trying to download from source
  • 那么需要重新下载random_compat.
    执行 composer require paragonie/random_compat:2.*

    1. 生成key. php artisan key:generate
    2. 把项目主目录设到ldemo/public目录下,访问http://localhost/.

    laravel 安装

    标签:download   进入   could not   not   get   could   operation   访问   The   

    原文地址:https://blog.51cto.com/3154408/2489442

    (0)
    (0)
       
    举报
    评论 一句话评论(0
    登录后才能评论!
    © 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
    迷上了代码!