ubuntu server 14.04 安装symfony2

1. 安装composer

php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php

php composer-setup.php

php -r "unlink('composer-setup.php');"


2) 配置全量镜像

composer config -g repo.packagist composer https://packagist.phpcomposer.com


参考 http://pkg.phpcomposer.com/

2. 安装symfony2

composer create-project symfony/framework-standard-edition=2.8.* my_project -vvv

ps: 这里安装了LTS版本的symfony


3. 配置VirtualHost

1)复制一份/etc/apache2/sites-available/下的000-default.config重命名为your_project.conf.编辑这个文件为:

例如:

<VirtualHost *:80>

        ServerName ldev.www.yoursite.com

        ServerAlias ldev.yoursite.com

        DocumentRoot your_project/web

        <Directory your_project/web>

          Require all granted

          <IfModule mod_rewrite.c>

            Options -MultiViews

            RewriteEngine On

            RewriteCond %{REQUEST_FILENAME} !-f

            RewriteRule ^(.*)$ app.php [QSA,L]

          </IfModule>

        </Directory>


        ErrorLog ${APACHE_LOG_DIR}/error.log

        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

保存文件,启用: sudo a2ensite your_project.conf


你可能感兴趣的:(ubuntu server 14.04 安装symfony2)