Rodolfo Bandeira

Rodolfo Bandeira

software, electronics, security, devops, thoughts

Welcome to Symfony Framework

In this post I will describe my experience installing the Symfony PHP Framework on CentOS Linux Server

At first, download the Symfony in: http://symfony.com/download

I decided for this one: (http://symfony.com/download?v=Symfony_Standard_Vendors_2.4.2.tgz)

wget http://symfony.com/download?v=Symfony_Standard_Vendors_2.4.2.tgz

If you are familiar with Composer 2, you can download Composer and then run the following command instead of downloading the archive. Its a good option to use it because it downloads all dependencies of symfony: (https://getcomposer.org/download/)

Installing using CURL:

curl -sS https://getcomposer.org/installer | php

Extracting the .tgz in my PUBLIC_HTML directory, we can test using this url:

http://YourWebSite/Symfony/web/app_dev.php

I got this message:** “ClassNotFoundException: Attempted to load class “DOMDocument” from the global namespace in” **

The solution I found in StackOverflow: (http://stackoverflow.com/questions/21918356/symfony-app-dev-php-install-domdomain-error)

This message was showing because my server doesn’t have DOM extensions. I solve it just typing:

sudo yum install php-xml<br /> sudo service httpd restart

After installing php-xml, I got other error message:  “ContextErrorException: Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Etc/GMT+3′ for ‘GMT+3/-3.0/no DST’ instead in”

I found the solution in StackOverflow: (http://stackoverflow.com/questions/20483830/symfony2-on-ubuntu-contexterror-default-timezome)

sudo vim php.ini

And edit this line:

date.timezone = America/Sao_Paulo

You can find all timezone areas in this website: (http://br1.php.net/manual/en/timezones.php)

sudo httpd restart

If you are using Ubuntu running on Amazon AWS EC2, you have to change the policy of your /var/www/html folder. Some exceptions is gonna happen if you don’t put your ubuntu user to www-data group and change the html folder to www-data group.

sudo usermod -a -G www-data ubuntu<br /> groups ubuntu<br /> sudo chgrp -hR /var/www/html www-data<br />

Yeah! It’s working! I have to agree I didn’t like of the installation problems. I hope codding with Symfony is gonna worth something!

MySymfony2

Rodolfo

Last modified:

LinkedIn
WhatsApp