Home Backend Development PHP Tutorial Laravel自学第一课:laravel下载与装配

Laravel自学第一课:laravel下载与装配

Jun 13, 2016 pm 12:27 PM
app debug env key laravel

Laravel自学第一课:laravel下载与安装

本地安装laravel,php环境要配置好,推荐xmapp一键搭建。

1、程序包直接从官方下载,官方开源地址:https://github.com/laravel/laravel(当然也可从此网站:http://www.golaravel.com/download/ 下载一键安装包,下载下来就可以看到页面,这里不讨论)。

2、解压后的文件夹放置本地环境目录,访问http://localhost/laravel/是无法访问的,laravel将起始页面放在了public目录,访问如下地址开始吧。

http://localhost/laravel/public/,很不幸,报错了,如下图,意思是没有找到vendor目录下的autoload.php目录。当然你是怎么也找不到这个文件的,因为根本就没有。

 

3、接下来需要安装composer(自行安装吧),运行命令行,转到laravel目录,输入

composer install

命令,如下图:

等待安装完成,laravel文件夹就出现了wendor目录。

4、你发现你依然不能访问,出现了两行大大的“Whoops, looks like something went wrong.”。这是我们没有开启debug,所以看不到错误提示。

打开laravel\config目录的app.php,修改

'debug' => env('APP_DEBUG', false), 为 'debug' => env('APP_DEBUG', true),

我们就看到了错误信息:’No supported encrypter found. The cipher and / or key length are invalid.‘。

不要着急,这是因为我们没有配置.env文件。找到laravel目录下的.env.example将其重命名.env即可。如果你是window系统,会弹出下图提示

解决方法很简单:用记事本另存,重命名即可。

现在依然不能访问,因为.env的app_key没有设置。在命令行输入:

php artisan key:generate

.env文件会自动生成app_key,偷懒的方法是随便搞一个32个字符。

 

看到’Laravel 5‘这几个大字就说明安装成功了。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Steps and precautions for registering a Hong Kong Apple ID (enjoy the unique advantages of the Hong Kong Apple Store) Steps and precautions for registering a Hong Kong Apple ID (enjoy the unique advantages of the Hong Kong Apple Store) Sep 02, 2024 pm 03:47 PM

Apple's products and services have always been loved by users around the world. Registering a Hong Kong Apple ID will bring more convenience and privileges to users. Let’s take a look at the steps to register a Hong Kong Apple ID and what you need to pay attention to. How to register a Hong Kong Apple ID When using Apple devices, many applications and functions require using Apple ID to log in. If you want to download applications from Hong Kong or enjoy the preferential content of the Hong Kong AppStore, it is very necessary to register a Hong Kong Apple ID. This article will detail the steps on how to register a Hong Kong Apple ID and what you need to pay attention to. Steps: Select language and region: Find the "Settings" option on your Apple device and enter

Unpatchable Yubico two-factor authentication key vulnerability breaks the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices Unpatchable Yubico two-factor authentication key vulnerability breaks the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices Sep 04, 2024 pm 06:32 PM

An unpatchable Yubico two-factor authentication key vulnerability has broken the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices. The Feitian A22 JavaCard and other devices using Infineon SLB96xx series TPMs are also vulnerable.All

Laravel - Pagination Customizations Laravel - Pagination Customizations Aug 27, 2024 am 10:51 AM

Laravel - Pagination Customizations - Laravel includes a feature of pagination which helps a user or a developer to include a pagination feature. Laravel paginator is integrated with the query builder and Eloquent ORM. The paginate method automatical

How to get the return code when email sending fails in Laravel? How to get the return code when email sending fails in Laravel? Apr 01, 2025 pm 02:45 PM

Method for obtaining the return code when Laravel email sending fails. When using Laravel to develop applications, you often encounter situations where you need to send verification codes. And in reality...

Laravel schedule task is not executed: What should I do if the task is not running after schedule: run command? Laravel schedule task is not executed: What should I do if the task is not running after schedule: run command? Mar 31, 2025 pm 11:24 PM

Laravel schedule task run unresponsive troubleshooting When using Laravel's schedule task scheduling, many developers will encounter this problem: schedule:run...

In Laravel, how to deal with the situation where verification codes are failed to be sent by email? In Laravel, how to deal with the situation where verification codes are failed to be sent by email? Mar 31, 2025 pm 11:48 PM

The method of handling Laravel's email failure to send verification code is to use Laravel...

How to implement the custom table function of clicking to add data in dcat admin? How to implement the custom table function of clicking to add data in dcat admin? Apr 01, 2025 am 07:09 AM

How to implement the table function of custom click to add data in dcatadmin (laravel-admin) When using dcat...

Laravel - Dump Server Laravel - Dump Server Aug 27, 2024 am 10:51 AM

Laravel - Dump Server - Laravel dump server comes with the version of Laravel 5.7. The previous versions do not include any dump server. Dump server will be a development dependency in laravel/laravel composer file.

See all articles