You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Web Server Configuration](#web-server-configuration)
8
-
-[Pretty URLs](#pretty-urls)
3
+
-[安装](#installation)
4
+
-[服务器要求](#server-requirements)
5
+
-[安装 Laravel](#installing-laravel)
6
+
-[配置](#configuration)
7
+
-[Web 服务器配置](#web-server-configuration)
8
+
-[优雅链接](#pretty-urls)
9
9
10
10
<aname="installation"></a>
11
-
## Installation
11
+
## 安装
12
12
13
-
> {video} Are you a visual learner? Laracasts provides a [free, thorough introduction to Laravel](https://laracasts.com/series/laravel-from-scratch-2017)for newcomers to the framework. It's a great place to start your journey.
The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the [Laravel Homestead](/docs/{{version}}/homestead)virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.
However, if you are not using Homestead, you will need to make sure your server meets the following requirements:
20
+
然而,如果你没有使用 Homestead ,你需要确保你的服务器上安装了下面的几个拓展:
21
21
22
22
<divclass="content-list"markdown="1">
23
23
- PHP >= 5.6.4
@@ -29,62 +29,63 @@ However, if you are not using Homestead, you will need to make sure your server
29
29
</div>
30
30
31
31
<aname="installing-laravel"></a>
32
-
### Installing Laravel
32
+
### 安装 Laravel
33
33
34
-
Laravel utilizes[Composer](https://getcomposer.org)to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine.
First, download the Laravel installer using Composer:
38
+
首先,使用 Composer 下载 Laravel 安装包:
39
39
40
40
composer global require "laravel/installer"
41
41
42
-
Make sure to place the `$HOME/.composer/vendor/bin`directory (or the equivalent directory for your OS) in your $PATH so the `laravel`executable can be located by your system.
Once installed, the `laravel new` command will create a fresh Laravel installation in the directory you specify. For instance, `laravel new blog` will create a directory named `blog` containing a fresh Laravel installation with all of Laravel's dependencies already installed:
44
+
一旦安装完成,就可以使用`laravel new`命令在指定目录创建一个新的 Laravel 项目,例如:`laravel new blog`将会在当前目录下创建一个叫` blog `的目录,此目录里面存放着新安装的 Laravel 和代码依赖。
45
45
46
46
laravel new blog
47
47
48
-
#### Via Composer Create-Project
48
+
#### 通过 Composer Create-Project
49
49
50
-
Alternatively, you may also install Laravel by issuing the Composer `create-project`command in your terminal:
composer create-project --prefer-dist laravel/laravel blog
53
53
54
-
#### Local Development Server
54
+
#### 本地开发服务器
55
55
56
-
If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the `serve`Artisan command. This command will start a development server at`http://localhost:8000`:
After installing Laravel, you should configure your web server's document / web root to be the `public`directory. The`index.php`in this directory serves as the front controller for all HTTP requests entering your application.
67
+
在安装 Laravel 之后,你需要配置你的 Web 服务器的根目录为 `public`目录。 这个目录的`index.php`文件作为所有 HTTP 请求进入应用的前端处理器。
68
68
69
-
#### Configuration Files
69
+
#### 配置文件
70
70
71
-
All of the configuration files for the Laravel framework are stored in the `config`directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.
After installing Laravel, you may need to configure some permissions. Directories within the `storage`and the `bootstrap/cache`directories should be writable by your web server or Laravel will not run. If you are using the [Homestead](/docs/{{version}}/homestead)virtual machine, these permissions should already be set.
The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the `php artisan key:generate`command.
Typically, this string should be 32 characters long. The key can be set in the `.env` environment file. If you have not renamed the `.env.example` file to `.env`, you should do that now. **If the application key is not set, your user sessions and other encrypted data will not be secure!**
Laravel needs almost no other configuration out of the box. You are free to get started developing! However, you may wish to review the `config/app.php` file and its documentation. It contains several options such as `timezone` and `locale` that you may wish to change according to your application.
84
+
#### 额外配置
86
85
87
-
You may also want to configure a few additional components of Laravel, such as:
@@ -93,16 +94,18 @@ You may also want to configure a few additional components of Laravel, such as:
93
94
</div>
94
95
95
96
<aname="web-server-configuration"></a>
96
-
## Web Server Configuration
97
+
## Web 服务器配置
97
98
98
99
<aname="pretty-urls"></a>
99
-
### Pretty URLs
100
+
### 优雅连接
100
101
101
102
#### Apache
102
103
103
-
Laravel includes a `public/.htaccess` file that is used to provide URLs without the `index.php` front controller in the path. Before serving Laravel with Apache, be sure to enable the `mod_rewrite` module so the `.htaccess` file will be honored by the server.
0 commit comments