Last active
October 1, 2015 19:41
-
-
Save chrisshennan/ad960332977496a419c0 to your computer and use it in GitHub Desktop.
Installing & Configuring Symfony2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test the database connection using a simple query (no database tables required) | |
cd /data/projects/insidethe.agency | |
php app/console doctrine:query:sql "SELECT NOW()"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the projects folder | |
mkdir -parents /data/projects | |
cd /data/projects/ | |
# Create a new symfony2 project | |
symfony new insidethe.agency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download the Symfony2 installer | |
sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony | |
sudo chmod a+x /usr/local/bin/symfony |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download composer | |
curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch the Symfony2 built-in webserver on the default port (8000) | |
cd /data/projects/insidethe.agency | |
php app/console server:run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Go to the root of the project | |
cd /data/projects/insidethe.agency | |
# Remove any cache & log files that currently exists | |
rm -rf app/cache/* | |
rm -rf app/logs/* | |
# Set the correct permission on the cache and log directories | |
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
sudo chmod +a "$HTTPDUSER 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the demo application | |
cd /data/projects | |
symfony demo demo | |
# Run the built-in webserver | |
cd /data/projects/demo | |
php app/console server:run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment