Linux系统下symfony安装的步骤和过程是怎样
Admin 2022-05-24 群英技术资�
tony@ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS Release: 14.04 Codename: trusty
symfony2.8
均使� apt-get
安装
至少要有个PHP5.4的环�
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,启动后,通过
https://localhost:8000` 就能看到他的欢迎页面�
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: # https://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端口,通过访问这个端口,也可以直接看到欢迎页面
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:[email protected]进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容�
猜你喜欢
ubuntu恢复成安装状态的方法:首先打开一个终端窗口,输入密码进入;然后输入TimeShift并打开;最后选择不同的驱动器或分区进行备份即可�
下面由linux系统教程栏目给大家介绍Linux如何安装Symfony2.8,希望对需要的朋友有所帮助�
现在大家使用最多的虚拟机软件就是VMware了,很多朋友不知道如何在VM虚拟机中安装win7系统,下文就为大家详细介绍,一起看看吧
服务器怎么装系统,哪些方面是要注意的?服务器系统的安装关键有一个磁盘阵列驱动的安装,因为习惯了普通PC机的朋友,往往是光盘引导安装,会发现根本装不上去了,或装上不无法运行了。因为一般系统里没有磁盘阵列卡的驱动,要另外安装的。下面就几种方式来交流一下了�
最近win11受到广告网友喜爱,那如何手动更新win11呢?下文小编就为大家带来了详细的的安装教程,需要的朋友一起看看吧
成为群英会员,开启智能安全云计算之旅
立即注册Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所�
增值电信经营许可证 : B1.B2-20140078