日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Linux中怎么安裝Symfony2.8
這篇文章主要介紹Linux中怎么安裝Symfony2.8,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

這篇文章主要介紹Linux中怎么安裝Symfony2.8,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!Linux 安裝 Symfony2.8

環(huán)境說明操作系統(tǒng)tony@ubuntu:~$ lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription:    Ubuntu 14.04.2 LTSRelease:        14.04Codename:       trustySymfonysymfony2.8安裝準(zhǔn)備

創(chuàng)新互聯(lián)建站于2013年開始,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站建設(shè)、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元海州做網(wǎng)站,已為上家服務(wù),為海州各地企業(yè)和個人服務(wù),聯(lián)系電話:18982081108

均使用 apt-get 安裝

PHP5.4

至少要有個PHP5.4的環(huán)境

nginx

web server 是少不了了

安裝步驟

1.下載官方命令工具

sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfonysudo chmod a+x /usr/local/bin/symfony

2.創(chuàng)建項(xiàng)目

這里執(zhí)行項(xiàng)目創(chuàng)建時,會從官網(wǎng)下載源碼包,執(zhí)行完后就能在當(dāng)前目錄看到了

symfony new symfony2.8 2.8

這里我創(chuàng)建了一個新的項(xiàng)目叫symfony2.8, 最后的2.8(不是項(xiàng)目名字中的2.8) 是要下載指定的symfony2.8版本的源碼,如果要下載的是其他版本, 修改一下接口
3.檢測

在安裝完后, symfony還會進(jìn)行一些檢測, 看看你的操作系統(tǒng)環(huán)境是否適合運(yùn)行symfony, 按照提示將缺失的擴(kuò)展安裝(我安裝了intl)或者將PHP的配置修改(我就改了時區(qū)),再執(zhí)行

php symfony2.8/bin/symfony_requirements

再次檢測是否通過(php 后面的文件就在新創(chuàng)建的項(xiàng)目中,我這里項(xiàng)目名是symfony2.8)

運(yùn)行

symfony2.8' 自帶的console(位置symfony2.8/bin/console)可以臨時啟動一個webserver,默認(rèn)端口是8000,啟動后,通過http://localhost:8000` 就能看到他的歡迎頁面了

nginx 配置

nginx 的配置其官方文檔里也有, 這里直接把我的復(fù)制過來,我也是直接修改的官方文檔

server {    listen 8028;    #server_name domain.tld www.domain.tld;    root /data/app/symfony2.8/web;    location / {        # try to serve file directly, fallback to app.php        try_files $uri /app.php$is_args$args;    }    # DEV    # This rule should only be placed on your development environment    # In production, don't include this and don't deploy app_dev.php or config.php    location ~ ^/(app_dev|config)\.php(/|$) {        fastcgi_pass 127.0.0.1:9000;        fastcgi_split_path_info ^(.+\.php)(/.*)$;        include fastcgi_params;        # When you are using symlinks to link the document root to the        # current version of your application, you should pass the real        # application path instead of the path to the symlink to PHP        # FPM.        # Otherwise, PHP's OPcache may not properly detect changes to        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126        # for more information).        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;        fastcgi_param DOCUMENT_ROOT $realpath_root;    }    # PROD    location ~ ^/app\.php(/|$) {        fastcgi_pass unix:/var/run/php5-fpm.sock;        fastcgi_split_path_info ^(.+\.php)(/.*)$;        include fastcgi_params;        # When you are using symlinks to link the document root to the        # current version of your application, you should pass the real        # application path instead of the path to the symlink to PHP        # FPM.        # Otherwise, PHP's OPcache may not properly detect changes to        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126        # for more information).        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;        fastcgi_param DOCUMENT_ROOT $realpath_root;        # Prevents URIs that include the front controller. This will 404:        # http://domain.tld/app.php/some-path        # Remove the internal directive to allow URIs like this        internal;    }    # return 404 for all other php files not matching the front controller    # this prevents access to other php files you don't want to be accessible.    location ~ \.php$ {      return 404;    }    error_log /data/log/nginx/symfony_error.log;    access_log /data/log/nginx/symfony_access.log;}

需要注意的是, nginx中包含了一個在開發(fā)環(huán)境適用的配置和一個在生產(chǎn)環(huán)境適用的配置,在生產(chǎn)華景部署的時候, 一定不要講開發(fā)環(huán)境的配置帶上去了

配置好后, 重新reload nginx,我這里監(jiān)聽的是虛擬機(jī)的8028端口,通過訪問這個端口,也可以直接看到歡迎頁面


分享題目:Linux中怎么安裝Symfony2.8
鏈接分享:http://www.dlmjj.cn/article/icchsp.html