站長資訊網
最全最豐富的資訊網站

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

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

環境說明

操作系統

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

安裝準備

均使用 apt-get 安裝

PHP5.4

至少要有個PHP5.4的環境

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.創建項目

這里執行項目創建時,會從官網下載源碼包,執行完后就能在當前目錄看到了

symfony new symfony2.8 2.8

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

3.檢測
在安裝完后, symfony還會進行一些檢測, 看看你的操作系統環境是否適合運行symfony, 按照提示將缺失的擴展安裝(我安裝了intl)或者將PHP的配置修改(我就改了時區),再執行

php symfony2.8/bin/symfony_requirements

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

運行

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

nginx 配置

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

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中包含了一個在開發環境適用的配置和一個在生產環境適用的配置,在生產華景部署的時候, 一定不要講開發環境的配置帶上去了

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

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

推薦學習:《linux視頻教程》

贊(0)
分享到: 更多 (0)
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
国产精品小黄鸭一区二区三区 | 亚洲国产成人91精品| 久久久久99精品成人片三人毛片 | AV天堂午夜精品一区| 日韩一区精品视频一区二区| 亚洲国产精品成人午夜在线观看 | 国产主播精品在线| 久久av老司机精品网站导航| 九九九精品视频免费| 国产精品美女久久久网站动漫| 国产在线观看麻豆91精品免费| 国产成人精品无码免费看| 日韩伦理片电影在线免费观看| 国产精品日本亚洲777| 老司机精品视频在线| 四虎精品影院在线观看视频| 国产精品va一级二级三级| 78成人精品电影在线播放| 99精品国产高清自在线看超| 久久精品人人爽人人爽快| 久久精品成人免费网站| 亚洲一区精品无码| 国产成人精品日本亚洲专区61| 久久久久无码精品| 国产麻豆精品入口在线观看| 亚洲AV日韩精品一区二区三区| 国产亚洲日韩在线a不卡| 免费日韩在线视频| 日韩色视频一区二区三区亚洲| 日韩精品无码一区二区三区不卡| 中文日韩字幕一区在线观看| 亚洲日韩在线观看| 亚洲 日韩经典 中文字幕| 国产精品日韩AV在线播放| 2015日韩永久免费视频播放| 日韩成人免费aa在线看| 精品人妻一区二区三区四区在线| 精品中文字幕一区二区三区四区| 精品中文字幕一区二区三区四区 | 久久99精品视频| 99亚洲精品高清一二区|