由于工作需要特去從零學(xué)習(xí)laravel。
創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站制作、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿(mǎn)足客戶(hù)于互聯(lián)網(wǎng)時(shí)代的望奎網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
真的是如laravel中文網(wǎng)所說(shuō)的樣子:一開(kāi)始接觸laravel最好是一鍵安裝集成包,省得開(kāi)頭就被(composer)難住以至于未開(kāi)始已經(jīng)受挫了。
被整了一天多,記錄下來(lái)方便碰到的朋友少走彎路。
我的環(huán)境是:
PHP-7.0.1
Centos-6.5
MySQL-5.6.28
Apache-2.2
其實(shí)也就跟php環(huán)境有關(guān)。
首先composer這一步少不了,這是玩laravel的開(kāi)始關(guān)鍵步驟,推薦(http://www.2cto.com/os/201512/452685.html)這篇文章為安裝指導(dǎo)。
composer完成之后,即可通過(guò)它來(lái)下載laravel安裝包了
composer global require "laravel/installer"
為了方便使用這里編輯.bash_profile文件來(lái)增加一個(gè)環(huán)境變量如下:
借用中文網(wǎng)一段話(huà)
一旦安裝完成后,就可以使用 laravel new
命令在你指定的目錄中建立一份全新安裝的 Laravel
應(yīng)用。例如: laravel new blog
命令會(huì)在當(dāng)前目錄下建立一個(gè)名為 blog
的目錄, 此目錄里面存放著全新安裝的 Laravel ,并且所有依賴(lài)包也已經(jīng)安裝好了。此方法的安裝速度會(huì)比通過(guò) Composer 安裝快很多。
laravel new blog
看到此界面說(shuō)明composer和laravel已經(jīng)沒(méi)問(wèn)題,可以正常安裝了。
laravel的安裝需要php的mbstring、openssl 擴(kuò)展,這兩個(gè)擴(kuò)展安裝比較麻煩,索引我就重新編譯安裝了php(辛虧我之前安裝php的時(shí)候留下了源碼安裝包),沒(méi)有源碼包的話(huà)只能建議你去google去了。
過(guò)程中有可能錯(cuò)誤的地方:
[root@iZ288zds0s2Z html]# laravel new blog
Crafting application...
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.2.31 -> satisfiable by laravel/framework[v5.2.31].
- laravel/framework v5.2.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Application ready! Build something amazing.
[root@iZ288zds0s2Z html]# laravel new blog
[RuntimeException]
Application already exists!
new [--dev] [--] [<name>]
在安裝下載的時(shí)候可能會(huì)碰到傳輸異常、端口問(wèn)題:
[Composer\Downloader\TransportException]
The "http://packagist.org/p/provider-latest%2455c2327270000a6a2c27c78e3109410de72e32fe9893b3c1269bd9507fdf3629.json" file could n
ot be downloaded (HTTP/1.1 302 Found)
[Composer\Downloader\TransportException]
Content-Length mismatch
這只是因?yàn)橥鈬?guó)網(wǎng)站的緣故(傳輸時(shí)間超世、中斷),只需要重新執(zhí)行一次即可,一次不行,再執(zhí)行一次,直到成功為止。
最后還會(huì)有個(gè)權(quán)限問(wèn)題:
測(cè)試環(huán)境階段我就直接給了777權(quán)限:chmod 777 -R /var/www/html/blog/
都完成之后就可以看到laravel的初始主界面了
當(dāng)前題目:淺談laravel5.X安裝centos6.5系統(tǒng)
本文地址:http://jinyejixie.com/article10/ppesdo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)、外貿(mào)建站、網(wǎng)站收錄、品牌網(wǎng)站建設(shè)、網(wǎng)站制作、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)