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
0 nhận xét:
Đăng nhận xét