Installing Symfony Framework in Ubuntu
Install these packages with apt:
php5
php5-cli
php5-dev
php5-sqlite
php-pear
$ sudo apt-get install php5 php5-cli php5-dev php5-sqlite php-pear
Test if Apache and PHP are up and running typing in the browser:
http://localhost/
You should see something like:
Apache/2.0.55 (Ubuntu) PHP/5.1.2-1ubuntu1 Server at localhost Port 80
From the command line, as root:
$ sudo pear upgrade PEAR $ sudo pear channel-discover pear.symfony-project.com
Edit /etc/php5/cli/php.ini and change the line:
memory_limit = 8M To memory_limit = 16M
Then
$ sudo pear install symfony/symfony $ sudo pear install –alldeps http://phing.info/pear/phing-current.tgz
Using the command:
$ sudo pear config-show
we find the symfony libraries have been installed in:
$ php_dir/symfony/ /usr/share/php/symfony/ main libraries $ data_dir/symfony/ /usr/share/php/data/symfony/ skeleton of symfony applications, default modules and configuration $ doc_dir/symfony/ /usr/share/php/docs/symfony/ documentation
From the command line enter bellow command:
$ symfony -Vsymfony version 0.6.2
From the command line, as root:
$ mkdir /var/www/myproject $cd /var/www/myproject $ symfony init-project myproject $ symfony init-app myapp
Edit /Virtual Host configuration file , and append the following at the end:
<VirtualHost 192.168.1.2:81>
ServerAdmin webmaster@localhost
ServerName servername.com
ServerAlias www.servername.com
DocumentRoot /var/www/project/web
Alias /sf /usr/share/php/data/symfony/web/sf
<Directory /var/www/project/web>
Options FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Posted by Shahid
One response to "Installing Symfony Framework in Ubuntu"
5:58 on May 9th, 2009
I have tried almost every framework for PHP that there is and have yet to find one I can work with on a long term basis. Symfony looks like a winner now that I have finally managed to install it (already tried 4 other tutorials).
Thanks for the great tutorial, it worked first time!