, ,

Installing symfony 1.4.6 without pear is not that difficult. In my earlier post I show you how to install symfony 1.4.6 with pear installation. That may not be helpful for those who don’t have Internet. So I insist to show you how to install symfony 1.4.6 without pear.

Let’s start.

Step-01. First make directory under /var/www/ folder. Suppose a folder name ‘smronju’. You can do it in command line like
sudo mkdir -p /var/www/smronju

Step-02. As a best practice, many people install the symfony framework files in the lib/vendor directory. Let’s create these directory:
sudo mkdir -p lib/vendor

Step-03. Download the symfony 1.4 project files from here and after that put the archive under the freshly created lib/vendor/ directory, un-archive it, and rename the directory to symfony

cd lib/vendor
tar zxpf symfony-1.4.0.tgz
mv symfony-1.4.0 symfony //You can use any name instead of symfony as you want
rm symfony-1.4.0.tgz

You can check symfony version using this command.
php lib/vendor/symfony/data/bin/symfony -V // note that capital V.

Step-04. Project creation
From the smronju directory run the symfony generate:project task to create project.

php lib/vendor/symfony/data/bin/symfony generate:project myproject //Change myproject to your own project name.

Step-05. Application creation

Now create the frontend application by running the generate:app task
php symfony generate:app frontend

Before trying to access our newly created project, we need to set the write permisstions on cache/ and log/ directories to the appropriate levels, so that our web server can write to them
sudo chmod 0777 cache/ log/

That’s it we are almost done. Finally we will create virtual host for it. Go to the /etc/apache2/sites-available/ folder and make a file named ‘smronju’. Open it using text editor or medit. Paste the following code snippet in it.

<VirtualHost *:80>
ServerAdmin webmaster@smronju.com
ServerName local.smronju.com
DirectoryIndex index.php
DocumentRoot /var/www/smronju/web
<Directory /var/www/smronju/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Alias /sf /var/www/smronju/lib/vendor/symfony/data/web/sf
<Directory "/var/www/smronju/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
ErrorLog /var/log/apache2/smronju.error.log
LogLevel warn
CustomLog /var/log/apache2/smronju.access.log combined

Make this available to sites-available using this command sudo a2ensite smronju

Finally restart or reload your apache server using sudo /etc/init.d/apache2 reload. Now test symfony by typing local.smronju.com in your browsers address bar. If everything goes well you will see below image.


Any bug please comment and happy coding 🙂