mac环境安装symfony2

时间:2022-03-24 08:35:43

1.命令行安装composer

$ curl -sS https://getcomposer.org/installer | php 
$ sudo mv composer.phar /usr/local/bin/composer


2.composer安装symfony2

composer create-project symfony/framework-standard-edition  /Library/WebServer/Documents/symfony_test


3.配置权限

cd symfony_test

chmod -R 777 app/cache
chmod -R 777 app/logs


3.配置vhosts

添加127.0.0.1  test.symfony.com


4.配置httpd-vhosts.conf

添加

<VirtualHost *:81>
    DocumentRoot "/Library/WebServer/Documents/symfony_test/web"
    ServerName sy.localhost
    <Directory "/Library/WebServer/Documents/symfony_test/web">
        Options Indexes FollowSymlinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog "/private/var/log/apache2/sf2project-error_log"
    CustomLog "/private/var/log/apache2/sf2project-access_log" common
</VirtualHost>


5.重启apache服务器

sudo apachectl restart