Tags
Recently I have started Symfony PHP framework to learn.I am running a LAMP server in ubuntu 10.04 and learned how to set up the Symfony framework. If you are a beginner then this may help you.
Make sure that you have install pear if not installed yet just run this command
sudo apt-get install php-pear
Okay lets get started with Symfony. Below command will setup the channel where you are going to download Symfony using pear PHP module.
sudo pear channel-discover pear.symfony-project.com
sudo pear install symfony/symfony-1.4.6
Almost finished! You have installed symfony on your system for use. Now setup a sample project for personal use. In my case the project name is ‘symfony’. Lets make it. First go to the /var/www directory and make a folder named ‘symfony’. Now initialize a new project named ‘symfony’ and create a new front end (Using command will do it for you).
cd /var/www
mkdir symfony
cd symfony
creating project
symfony generate:project symfony
if you need to connect database run below command
symfony configure:database "mysql:host=localhost;dbname=dbname" username password
frontend creation
symfony generate:app frontend
Next we have to create a symlink this will allow the new project we created to use the Symfony libraries and elements installed earlier. With me you are still in /var/www/symfony
cd web/
ln -s /usr/share/php/data/symfony/web/sf/
That’s it. Now you can visit your site. Enter in browser address bar http://localhost/symfony/web/
If everything is okay then you will get the image below.

Pingback: Installing Symfony without pear installation « SmRonju
fantastic , been having trouble installing symfony following the documentation from the project website. this works extremely fast
Thanks I also got problems following the documentation from symfony project website. By the way you can also install symfony without pear install. Click here
Hi
Hope you can help me out, I have followed step by step your tutorial but when I enter this command:
symfony generate:project symfony
This is what I get:
christian@christian-desktop:/var/www/symfony$ symfony generate:project symfony
PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
>> dir+ /var/www/symfony/apps
>> dir+ /var/www/symfony/lib
>> dir+ /var/www/symfony/lib/form
>> dir+ /var/www/symfony/lib/form
>> file+ /var/www/symfony/lib/form/BaseForm.class.php
PHP Warning: copy(/var/www/symfony/lib/form/BaseForm.class.php): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/web
>> dir+ /var/www/symfony/web
>> file+ /var/www/symfony/web/robots.txt
PHP Warning: copy(/var/www/symfony/web/robots.txt): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/web/css
>> dir+ /var/www/symfony/web/css
>> file+ /var/www/symfony/web/css/main.css
PHP Warning: copy(/var/www/symfony/web/css/main.css): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/web/images
>> dir+ /var/www/symfony/web
>> file+ /var/www/symfony/web/.htaccess
PHP Warning: copy(/var/www/symfony/web/.htaccess): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/web/js
>> dir+ /var/www/symfony/web/uploads
>> dir+ /var/www/symfony/web/uploads/assets
>> dir+ /var/www/symfony/config
>> dir+ /var/www/symfony/config
>> file+ /var/www/symfony/config/rsync_exclude.txt
PHP Warning: copy(/var/www/symfony/config/rsync_exclude.txt): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/config
>> file+ /var/www/symfony/config/ProjectConfiguration.class.php
PHP Warning: copy(/var/www/symfony/config/ProjectConfiguration.class.php): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/config
>> file+ /var/www/symfony/config/properties.ini
PHP Warning: copy(/var/www/symfony/config/properties.ini): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/cache
>> dir+ /var/www/symfony/test
>> dir+ /var/www/symfony/test/unit
>> dir+ /var/www/symfony/test/bootstrap
>> dir+ /var/www/symfony/test/bootstrap
>> file+ /var/www/symfony/test/bootstrap/functional.php
PHP Warning: copy(/var/www/symfony/test/bootstrap/functional.php): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/test/bootstrap
>> file+ /var/www/symfony/test/bootstrap/unit.php
PHP Warning: copy(/var/www/symfony/test/bootstrap/unit.php): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/test/functional
>> dir+ /var/www/symfony/plugins
>> file+ /var/www/symfony/symfony
PHP Warning: copy(/var/www/symfony/symfony): failed to open stream: Permission denied in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/data
>> dir+ /var/www/symfony/data/fixtures
>> dir+ /var/www/symfony/data/fixtures
>> file+ /var/www/symfony/data/fixtures/fixtures.yml
PHP Warning: copy(/var/www/symfony/data/fixtures/fixtures.yml): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/log
>> dir+ /var/www/symfony/config
>> dir+ /var/www/symfony/config/doctrine
>> dir+ /var/www/symfony/config/doctrine
>> file+ /var/www/symfony/config/doctrine/schema.yml
PHP Warning: copy(/var/www/symfony/config/doctrine/schema.yml): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
>> dir+ /var/www/symfony/config
>> file+ /var/www/symfony/config/databases.yml
PHP Warning: copy(/var/www/symfony/config/databases.yml): failed to open stream: No such file or directory in /usr/share/php/symfony/task/sfFilesystem.class.php on line 74
PHP Warning: file_get_contents(/var/www/symfony/config/ProjectConfiguration.class.php): failed to open stream: No such file or directory in /usr/share/php/symfony/util/sfClassManipulator.class.php on line 52
PHP Warning: file_put_contents(/var/www/symfony/config/ProjectConfiguration.class.php): failed to open stream: No such file or directory in /usr/share/php/symfony/util/sfClassManipulator.class.php on line 72
You must be in a symfony project directory.
I been strugling with this for 2 days straight and cant figure out what the problem is hope you can help me out find the solution.
Best Regards
Chris
Follow the steps carefully think you are making projects from outside your project directory.
If you have problems with pear installation try this.
I faced the same problem the second time around. The problem is with the permissions because you didn’t set the root permissions for the /var/www folder.
While using Sudo Symfony would help solve the issue , its not recommended because the other files created in the folder would require root permissions to access as well.
I recommend you to use Gksudo Nautilus in command terminal , manually set the permissions for your user account for the folders /var/www first , then go and recreate the folders for symfony. In that way, you’d have root access to it and the problem is solved.
Pingback: | My Planet
Hi…
I installed the symfony without any problems using this instructions. It is really correct way to do this. Thanks for your instructions.
Glad that it works for you