Skip to content

Instantly share code, notes, and snippets.

@Geoffrey-T
Last active December 25, 2015 02:29
Show Gist options
  • Save Geoffrey-T/6902462 to your computer and use it in GitHub Desktop.
Save Geoffrey-T/6902462 to your computer and use it in GitHub Desktop.
Mac symfony vhost
#add this file in /Applications/MAMP/conf/apache/extra
#and Add this line :
# Include /Applications/MAMP/conf/apache/extra/symfony.conf
# In httpd.conf file /Applications/MAMP/conf/apache
# Add this in /etc/hosts -> 127.0.0.1 symfony.dev
# Restart your apache server
# test in your browser : http://symfony.dev
# enjoy ! ou pas :(
# check config with terminal : php app/check.php
# check server config in url /config.php
# install brew : ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# brew install icu4c
# brew install autoconf
# pecl install intl -> get the path of icu4c (like /usr/local/Cellar/icu4c/51.1)
# for install pecl : curl -O http://pear.php.net/go-pear.phar
# sudo php -d detect_unicode=0 go-pear.phar
<VirtualHost *:8888>
DocumentRoot "pathToSymfony/web"
DirectoryIndex app_dev.php
ServerName symfony.dev
<Directory "pathToSymfony/web/web">
AllowOverride None
Allow from All
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app_dev\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app_dev.php [L]
</IfModule>
</Directory>
ErrorLog "/Users/gthenot/Desktop/www/php/symfony/Symfony/app/logs/apache_app_errors.log"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment