PHP开发:从基本环境,到正式环境,全过程迁移

来源:转载

1.找到Git在个人用户目录下 .ssh 文件夹里的公钥




[email protected] MINGW64 /e/Project$ cd [email protected] MINGW64 ~$ ls -altotal 23212drwxr-xr-x 1 Administrator 197121 0 9月 5 09:24 ./drwxr-xr-x 1 Administrator 197121 0 5月 24 13:14 ../drwxr-xr-x 1 Administrator 197121 0 7月 11 20:36
.android/drwxr-xr-x 1 Administrator 197121 0 10月 28 2016 .AndroidStudio2.2/drwxr-xr-x 1 Administrator 197121 0 6月 13 11:54 .AndroidStudio2.3/drwxr-xr-x 1 Administrator 197121 0 7月 10 11:47 .AndroidStudioPreview3.0/-rw-r--r-- 1 Administrator 197121 1486 8月
30 13:49 .bash_historydrwxr-xr-x 1 Administrator 197121 0 4月 21 10:50 .eclipse/-rw-r--r-- 1 Administrator 197121 16 10月 28 2016 .emulator_console_auth_token-rw-r--r-- 1 Administrator 197121 133 8月 30 13:04 .gitconfigdrwxr-xr-x 1 Administrator 197121 0 6月 13
11:28 .gradle/drwxr-xr-x 1 Administrator 197121 0 3月 10 11:36 .holocolors/-rw-r--r-- 1 Administrator 197121 16 8月 30 01:40 .ideavimrcdrwxr-xr-x 1 Administrator 197121 0 4月 21 10:50 .jmc/drwxr-xr-x 1 Administrator 197121 0 6月 26 21:40 .keras/drwxr-xr-x 1 Administrator
197121 0 8月 10 13:05 .matplotlib/drwxr-xr-x 1 Administrator 197121 0 7月 3 17:39 .oracle_jre_usage/drwxr-xr-x 1 Administrator 197121 0 10月 28 2016 .org.eclipse.sequoyah/drwxr-xr-x 1 Administrator 197121 0 8月 10 17:46 .PHPStorm2017.2/drwxr-xr-x 1 Administrator
197121 0 8月 8 20:50 .PyCharm2017.2/drwxr-xr-x 1 Administrator 197121 0 6月 27 15:53 .slime/drwxr-xr-x 1 Administrator 197121 0 8月 16 17:56 .ssh/drwxr-xr-x 1 Administrator 197121 0 11月 28 2016 .swt/drwxr-xr-x 1 Administrator 197121 0 10月 28 2016 .tooling/drwxr-xr-x
1 Administrator 197121 0 8月 19 14:48 .VirtualBox/-rw-r--r-- 1 Administrator 197121 42968 9月 2 20:11 _viminfolrwxrwxrwx 1 Administrator 197121 67 5月 24 13:14 「开始」菜单 -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu'/drwxr-xr-x 1 Administrator
197121 0 4月 5 03:27 '3D Objects'/drwxr-xr-x 1 Administrator 197121 0 8月 30 13:04 'AHK Scripts'/drwxr-xr-x 1 Administrator 197121 0 5月 24 13:14 AppData/lrwxrwxrwx 1 Administrator 197121 38 5月 24 13:14 'Application Data' -> /c/Users/Administrator/AppData/Roaming/drwxr-xr-x
1 Administrator 197121 0 8月 9 20:12 Contacts/lrwxrwxrwx 1 Administrator 197121 66 5月 24 13:14 Cookies -> /c/Users/Administrator/AppData/Local/Microsoft/Windows/INetCookies/drwxr-xr-x 1 Administrator 197121 0 8月 9 20:12 Desktop/drwxr-xr-x 1 Administrator 197121
0 8月 11 16:51 Documents/drwxr-xr-x 1 Administrator 197121 0 5月 24 13:32 Downloads/drwxr-xr-x 1 Administrator 197121 0 10月 31 2016 eclipse/drwxr-xr-x 1 Administrator 197121 0 8月 9 20:12 Favorites/-rw-r--r-- 1 Administrator 197121 65214 10月 28 2016 genymotion-log.zipdrwxr-xr-x
1 Administrator 197121 0 9月 5 09:14 IntelGraphicsProfiles/drwxr-xr-x 1 Administrator 197121 0 8月 9 20:12 Links/lrwxrwxrwx 1 Administrator 197121 36 5月 24 13:14 'Local Settings' -> /c/Users/Administrator/AppData/Local/drwxr-xr-x 1 Administrator 197121 0 5月
24 13:32 Music/lrwxrwxrwx 1 Administrator 197121 32 5月 24 13:14 'My Documents' -> /c/Users/Administrator/Documents/lrwxrwxrwx 1 Administrator 197121 74 5月 24 13:14 NetHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Network Shortcuts'/-rw-r--r--
1 Administrator 197121 12845056 9月 4 21:59 NTUSER.DAT-rw-r--r-- 1 Administrator 197121 3145728 5月 24 13:14 ntuser.dat.LOG1-rw-r--r-- 1 Administrator 197121 3240960 5月 24 13:14 ntuser.dat.LOG2-rw-r--r-- 1 Administrator 197121 1048576 9月 5 09:24 NTUSER.DAT{aba83784-403f-11e7-a287-c9e0e45a2a73}.TxR.0.regtrans-ms-rw-r--r--
1 Administrator 197121 1048576 9月 5 09:24 NTUSER.DAT{aba83784-403f-11e7-a287-c9e0e45a2a73}.TxR.1.regtrans-ms-rw-r--r-- 1 Administrator 197121 1048576 9月 5 09:24 NTUSER.DAT{aba83784-403f-11e7-a287-c9e0e45a2a73}.TxR.2.regtrans-ms-rw-r--r-- 1 Administrator 197121
65536 9月 5 09:24 NTUSER.DAT{aba83784-403f-11e7-a287-c9e0e45a2a73}.TxR.blf-rw-r--r-- 1 Administrator 197121 65536 8月 14 02:55 NTUSER.DAT{aba83785-403f-11e7-a287-c9e0e45a2a73}.TM.blf-rw-r--r-- 1 Administrator 197121 524288 8月 14 02:55 NTUSER.DAT{aba83785-403f-11e7-a287-c9e0e45a2a73}.TMContainer00000000000000000001.regtrans-ms-rw-r--r--
1 Administrator 197121 524288 5月 26 09:15 NTUSER.DAT{aba83785-403f-11e7-a287-c9e0e45a2a73}.TMContainer00000000000000000002.regtrans-ms-rw-r--r-- 1 Administrator 197121 20 5月 24 13:32 ntuser.inidrwxr-xr-x 1 Administrator 197121 0 6月 27 09:34 OneDrive/drwxr-xr-x
1 Administrator 197121 0 5月 24 13:32 Pictures/lrwxrwxrwx 1 Administrator 197121 74 5月 24 13:14 PrintHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Printer Shortcuts'/lrwxrwxrwx 1 Administrator 197121 63 5月 24 13:14 Recent -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Recent/drwxr-xr-x
1 Administrator 197121 0 8月 9 20:12 'Saved Games'/drwxr-xr-x 1 Administrator 197121 0 8月 9 20:12 Searches/lrwxrwxrwx 1 Administrator 197121 63 5月 24 13:14 SendTo -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/SendTo/lrwxrwxrwx 1 Administrator
197121 66 5月 24 13:14 Templates -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Templates/drwxr-xr-x 1 Administrator 197121 0 5月 24 13:32 Videos/drwxr-xr-x 1 Administrator 197121 0 8月 30 13:38 wc/-rw-r--r-- 1 Administrator 197121 17408 10月 28 2016
WebpageIcons.dbdrwxr-xr-x 1 Administrator 197121 0 10月 31 2016 workspace/[email protected] MINGW64 ~$ cd .ssh/[email protected] MINGW64 ~/.ssh$ ls -altotal 28drwxr-xr-x 1 Administrator 197121 0 8月 16 17:56 ./drwxr-xr-x 1 Administrator
197121 0 9月 5 09:24 ../-rw-r--r-- 1 Administrator 197121 3326 8月 16 17:51 id_rsa-rw-r--r-- 1 Administrator 197121 742 8月 16 17:51 id_rsa.pub-rw-r--r-- 1 Administrator 197121 803 8月 16 18:31 [email protected] MINGW64 ~/.ssh$ cat id_rsa.pubssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAACAQC+zl8WRLZBDSUW6TZ82zq68aYCywB5y7FdK/rsswuq16FUhcRap6pxJH2DcorNkddqEWrlmJARtpU1pGZWWXl7FXoVhthcR1rGo8TIxot2tCCcNtu43GmF4V31Ivizr9silgEXjEw+uklHUnrpuvF/nFtQUC4l3bkatl4RKx4Xv0OFlc0/wElZLhhCyYLd6iTvjd7pUDSeoLKq5BuREiLyI19YfqwpPnSJBVc67Ktex+QQrwr7dOKea1sEgAyT9vAs31dl3p1vpAExg5OjEC97LyXFiXLH/e/sBNj6r4p0u/nh1VGBwFvC/RuJsKQeRxsFMg9yRm9e0CIRhHzJF4VfqZxTPzPIL3JYrodTh+tBvXt8CmI6zhOMMDJ+s4bOreOQbBaDP4cHrRcDRakcKxdTrmzAb+s539pA+V0Fo8MWuO4yF9T1kLSzYx55ifHAK8ZvypIAwDj7LwpcelBzXb7+WhG35ogUgWTv2zThGQihUUqOZXMUCFuPtgMkAvG+Gk28pfmYPwIF/ENZ7iCFvwoEHR0h6tbFZu/DUGAvhXwrE9zEEqxMsC4iPdtmZO4R7fSCSXKygQdTWFERq6u1tBxfsiKmo3gEJnXK9crf2Myhj/TU9jeEztCYappJjHMpJI5QfWPaK1J2Digq9lobHN69Hw6HNLu3tfJ3JyR50h4d0Q==
[email protected]@DESKTOP-VM6Q616 MINGW64 ~/.ssh$

2.clone项目到本地 git clone xxxxxx:xxxxx/xxxxx

3.输入自己预先设置的密码


4.安装composer

[email protected] MINGW64 /e/Project$ git clone [email protected]:/data/git/www.contestia.com.gitCloning into 'www.contestia.com'...The authenticity of host '192.168.0.23 (192.168.0.23)' can't be established.ECDSA key fingerprint is SHA256:Zf24oXg2Rnc49iOgYyOqoCJzVtWKe3kXJzrX77Tp/cE.Are
you sure you want to continue connecting (yes/no)? yPlease type 'yes' or 'no': yesWarning: Permanently added '192.168.0.23' (ECDSA) to the list of known hosts.Enter passphrase for key '/c/Users/Administrator/.ssh/id_rsa':remote: Counting objects: 3693, done.remote:
Compressing objects: 100% (2774/2774), done.remote: Total 3693 (delta 2675), reused 1282 (delta 875)Receiving objects: 100% (3693/3693), 525.91 KiB | 0 bytes/s, done.Resolving deltas: 100% (2675/2675), done.Checking out files: 100% (259/259), [email protected]
MINGW64 /e/Project$ lswww.contestia.com/[email protected] MINGW64 /e/Project$ cd www.contestia.com/[email protected] MINGW64 /e/Project/www.contestia.com (master)$ lsaliyun/ bootstrap/ config/ package.json readme tests/app/ composer.json
database/ phpunit.xml resources/ v1testartisan* composer.lock gulpfile.js public/ server.php [email protected] MINGW64 /e/Project/www.contestia.com (master)$ composer --versionbash: composer: command not [email protected] MINGW64
/

按照官网教程

第一次


PS F:/Php Language Not Thread Safe> php -r "readfile('https://getcomposer.org/installer');" | php


php : 无法将“php”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。所在位置 行:1 字符: 1+ php -r "readfile('https://getcomposer.org/installer');" | php+ ~~~ + CategoryInfo : ObjectNotFound: (php:String) [], CommandNotFoundException + FullyQualifiedErrorId
: CommandNotFoundException

第二次


PS F:/Php Language Not Thread Safe> ./php -r "readfile('https://getcomposer.org/installer');" | ./phpPHP Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1PHP Warning:
readfile(https://getcomposer.org/installer): failed to open stream: Invalid argument in Command line code on line 1Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line
1

Warning: readfile(https://getcomposer.org/installer): failed to open stream: Invalid argument in Command line code on line 1

第三次注意: 如果收到
readfile 错误提示,请使用 http 链接或者在
php.ini 中开启 php_openssl.dll 。5.如果


提示php 命令找不到


那么需要添加


类似于


F:/php


F:/php/ext


变量名:PHPRC (环境配置)


变量值:F:/php (找到php.ini 文件)

6.composer这句话



在 composer.phar 同级目录下新建文件 composer.bat :


C:/bin>echo @php "%~dp0composer.phar" %*>composer.bat其实是指,直接在命令行,输入
echo @php "%~dp0composer.phar" %*>composer.bat
这样子就会自动生成一个 composer.bat文件。

注意:以上的情况,在没有配置全局环境变量的情况下, 只能在 PHP 的 composer.phar 文件所在目录下,用命令行,

就可达到查看版本效果

F:/Php Language Not Thread Safe>composer -v

以下是展示效果图


F:/Php Language Not Thread Safe>composer -v
______
/ ____/_______ ________________________
/ / / __ // __ `__ // __ // __ // ___/ _ // ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__)__/ /
/____//____/_/ /_/ /_/ .___//____/____//___/_/
/_/
Composer version 1.5.1 2017-08-09 16:07:22

7.


为composer 配置全局变量


http://www.cnblogs.com/liaozt/p/5976306.html


#!/usr/bin/env sh
# php /path/to/composer.phar $*
php `dirname $0`/composer.phar $*记得注释掉下面一行,然后 中间第二行 改为绝对路径 (并且绝对路径要是带空格, 则应该把整串路径用双引号 包裹起来)

8.


进入到项目地址。

删除原来的依赖文件,并重新自动生成依赖文件



输入 composer install

[email protected] MINGW64 /e/Project/www.contestia.com (master)
$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.2.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.45 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.44 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.43 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.42 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.40 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.39 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.38 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.37 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework 5.2.41 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
To enable extensions, verify that they are enabled in your .ini files:
- F:/Php Language Not Thread Safe/php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

也就是说,提示需要 Laravel。

9.

正好第9步,也是讲 Laravel的安装依赖。

10.



PHP Version 5.6.31
System
Windows NT DESKTOP-VM6Q616 10.0 build 15063 (Windows 10) AMD64Build Date
Jul 5 2017 22:19:48Compiler
MSVC11 (Visual C++ 2012)Architecture
x64Configure Command
cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:/php-sdk/oracle/x64/instantclient_12_1/sdk,shared"
"--with-oci8-12c=c:/php-sdk/oracle/x64/instantclient_12_1/sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"Server API
CGI/FastCGIVirtual Directory Support
disabledConfiguration File (php.ini) Path
C:/WINDOWSLoaded Configuration File
(none)


windows系统下,


在 nginx 下,



loaded configuration file 为 none 的问题



【搜索】https://www.baidu.com/s?wd=loaded%20configuration%20file%20none%20nginx%20windows&rsv_spt=1&rsv_iqid=0xe9161bf10001b120&issp=1&f=3&rsv_bp=1&rsv_idx=2&ie=utf-8&rqlang=cn&tn=baiduhome_pg&rsv_enter=1&inputT=1788&rsv_t=cbd18yH%2Bpc8TGmidsjptVeRnBQ89AEhB9wEg9cJzE852Iwa%2Bh0PpLHvwupjkgDD2xctu&rsv_sug3=5&oq=loaded%2520configuration%2520file%2520none%2520nginx&rsv_pq=bc6b78300000ac23&rsv_sug2=0&prefixsug=loaded%2520configuration%2520file%2520none%2520nginx%2520windows&rsp=0&rsv_sug4=2146



【解答:目录有空格】
http://cache.baiducontent.com/c?m=9d78d513d99d1cfc0ebac2690d67863b4500db367b9783532489cf5f93150f1a1931f4bb567e4d5884d27c165dfa1200a0e7360372587ce1c68dc95e9afbcc2775ce6176671df55c0f8347f29e5125b671d10cb5b81990e6a7748ee4898f9a030f9e045e67d3b0cd01514a9d72a64377b0fdc709085812bce93467f959&p=882a9645d7df12a05abcc329504b83&newp=c2769a4792d807c308e2977e0c49bb231610db2151d3d101298ffe0cc4241a1a1a3aecbf21251b02d3c5776501a94a5bedf03778310034f1f689df08d2ecce7e6b936158&user=baidu&fm=sc&query=loaded+configuration+file+none+nginx+windows&qid=c8c892980000aad0&p1=1&fast=y


解决办法:


1.修改掉PHP语言包所处目录,的空格。


2.修改配套的 ini 配置文件。


完成。


11.


继续安装

Laravel


a. 下载前,添加中国区镜像【参见Composer官网】

b.在 php.ini 文件中放开 mbstring 依赖的注释

c.在 php.in 文件中放开 ext-fileinfo 依赖的注释

d.有一个 gd库, 好像暂时没有, 先放在一边, 报错了再来


12.

复制已有的项目的另一份配置文件过来,

形如下面


1 APP_ENV=local
2 APP_DEBUG=true
3 APP_KEY=base64:Qk+9QoIXaVtgYKHm0BM3myf7/CghaMtaPigJihTbEMk=
4 APP_URL=http://localhost
5
6 DB_CONNECTION=mysql
7 DB_HOST=192.168.0.23
8 DB_PORT=3306
9 DB_DATABASE=contest_server
10 DB_USERNAME=dev
11 [email protected]
12
13 CACHE_DRIVER=file
14 SESSION_DRIVER=file
15 QUEUE_DRIVER=database
16
17 REDIS_HOST=127.0.0.1
18 REDIS_PASSWORD=null
19 REDIS_PORT=6379
20
21 MAIL_DRIVER=smtp
22 MAIL_HOST=mailtrap.io
23 MAIL_PORT=2525
24 MAIL_USERNAME=null
25 MAIL_PASSWORD=null
26 MAIL_ENCRYPTION=null
27
28 API_DOMAIN=app.contestia.com
29 API_PREFIX=null
30 API_VERSION=v1
31 API_DEFAULT_FORMAT=json
32 API_DEBUG=true

创建一个

.env

文件,

将以上文件载入。

13.

输入laravel的key命令:

php artisan key:generate(中间是个冒号 : )


附注:


(php artisan list 可以查看Laravel的常用命令集)

14.

当Laravel的一些依赖,安装好之后。

运行

php artisan serv


这个时候,会出现一行域名

形如:

[email protected] MINGW64 /e/Project/www.contestia.com (master)
$ php artisan serv
?[32mLaravel development server started on http://localhost:8000/?[39m
中间的一串,是域名

两侧的


?[32m
?[39m

这个是


laravel php artisan 乱码
https://segmentfault.com/q/1010000007146764



这些类似于 [37;41m 的玩意是 Unix Console Color Codes,用于在控制台里显示颜色的代码:http://bitmote.com/index.php?...



然而你用的是不支持这种颜色代码的 cmd,自然就会这样。
以上的这些,只是在显示上,有一定的区别。不影响实际功能。




于是我们,开始将上面那一串域名


Laravel development server started on http://localhost:8000/填入到浏览器中。————————

15.


此时,浏览器可能会报错

类似于找不到文件、

找不到文件夹这种。



大体上是上半部分下半部分两个错误。

然后我们就应该——————

a.


进入storage子文件夹。


$ cd storage/

b.


创建framework (丢失的文件夹)


$ mkdir framework

c.


创建framework / sessions (丢失的二级文件夹)


$ mkdir framework/sessions

d.


创建 framework / views (丢失的二级文件夹)


$ mkdir framework / views

e.


创建 framework / cache (丢失的二级文件夹)


$ mkdir framework / cache


f.


最后,还需要给予这些新建的文件夹,对应的Linux文件系统权限。(Git Bash 在Windows下,也可以用类似Linux的方式,操作文件权限等指令)


$ chmod -R 755 storage/


chmod —— change mode
-R 代表 递归的意思


755 rwx r-x r-x 三组权限——User,Group,Other

16.

此时,需要保持

命令行的 $ php artisan serv 开启。


(作用是:在后台维持一个运行)

然后


在浏览器输入刚才的网址



Laravel development server started on


htttp://localhost:8000/如果一切正常,那么就可以看到
Hello World !
17.然后,接下来要做的,


就是修改

nginx 的虚拟域名了, 起个简单好记的域名吧 !






分享给朋友:
您可能感兴趣的文章:
随机阅读: