Thứ Hai, 22 tháng 6, 2015

Symfony2: Create new project in Mac OX 10.10 Yosemite

create project in ~/Sites # in other will throw 404

change directory to project folder







run 2 commands:
sudo chmod +a "www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

Edit httpd-vhost.conf
#vhost.conf
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "~/Sites/restapi/web"
    ServerName restapi.localhost
    <Directory "~/Sites/restapi/web">
        Options Indexes FollowSymlinks
        AllowOverride All
        Order allow,deny
        Allow from all
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ /app.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>

clear for fix 404 error

php app/console cache:clear --env=dev
php app/console cache:clear --env=prod

restart apache2: sudo apachectl restart
- Comments

0 nhận xét:

Đăng nhận xét