站長(zhǎng)資訊網(wǎng)
        最全最豐富的資訊網(wǎng)站

        一文詳解Linux如何安裝Symfony2.8

        下面由linux系統(tǒng)教程欄目給大家介紹Linux如何安裝Symfony2.8,希望對(duì)需要的朋友有所幫助!

        環(huán)境說明

        操作系統(tǒng)

        tony@ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 14.04.2 LTS Release:        14.04 Codename:       trusty

        Symfony

        symfony2.8

        安裝準(zhǔn)備

        均使用 apt-get 安裝

        PHP5.4

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

        nginx

        web server 是少不了了

        安裝步驟

        1.下載官方命令工具

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

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

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

        symfony new symfony2.8 2.8

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

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

        php symfony2.8/bin/symfony_requirements

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

        運(yùn)行

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

        nginx 配置

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

        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中包含了一個(gè)在開發(fā)環(huán)境適用的配置和一個(gè)在生產(chǎn)環(huán)境適用的配置,在生產(chǎn)華景部署的時(shí)候, 一定不要講開發(fā)環(huán)境的配置帶上去了

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

        一文詳解Linux如何安裝Symfony2.8

        推薦學(xué)習(xí):《linux視頻教程》

        贊(0)
        分享到: 更多 (0)
        網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)
        主站蜘蛛池模板: 国产精品美女网站在线观看| 欧洲精品码一区二区三区免费看| 99久久国产主播综合精品 | 亚洲国产精品无码av| 国产免费久久精品丫丫| 精品久久一区二区三区| 国产精品无码久久综合| 亚洲欧洲国产精品香蕉网| 精品久久久久久无码中文字幕 | 国产精品自在线拍国产第一页| 国产精品爽黄69天堂a| 久久久免费精品re6| 日韩精品一区二区三区在线观看| 国产精品二区观看| 91精品在线国产| 久热这里只精品99re8久| 99RE6热在线精品视频观看| 精品国际久久久久999波多野| 亚洲国产精品福利片在线观看| 四虎精品成人免费视频| 蜜臀精品国产高清在线观看| 精品无码国产污污污免费网站国产 | 99视频精品全部在线观看| 久久精品国产亚洲AV无码娇色| 亚洲国产精品久久电影欧美| 亚洲精品高清国产一线久久| 中文字幕精品久久久久人妻| 综合在线视频精品专区| 亚洲精品欧美精品日韩精品| 亚洲精品视频久久久| 伊人久久精品影院| 少妇人妻无码精品视频| 熟女精品视频一区二区三区| 久久精品国产亚洲av水果派| 精品国产三级a∨在线欧美| 国产成人精品一区二区三区免费| 99re6在线精品免费观看| 久久福利青草精品资源站| 四虎影视国产精品亚洲精品hd| 国产VA免费精品高清在线| 精品久久久久久无码中文野结衣|