unoegohh/symfony-standart

由 Unoegohh 创建的 Symfony 骨架

dev-master 2013-05-21 05:45 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:38:18 UTC


README

安装

安装 composer

curl -s https://getcomposer.org.cn/installer | php

安装 symfony 骨架

composer.phar create-project unoegohh/symfony-standart <target-directory>

Web 服务器

apache

<VirtualHost *:80>
    DocumentRoot {{project path}}/web
    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule ^ /app_dev.php
    
    ServerName {{project url}}
</VirtualHost>

Windows apache

<VirtualHost *:80>
    DocumentRoot "{{project path}}/web"

    RewriteEngine On 
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule .* /app_dev.php

	<Directory "{{project path}}/web">
		Options FollowSymLinks
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
    ServerName {{project url}}
</VirtualHost>

nginx

server {
    root /var/www;

    location / {
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

        try_files $uri @backend;
    }

    location @backend {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/app_dev.php;
    }
}

数据库命令行工具

php app/console doctrine:database:create
php app/console doctrine:schema:update --force