Donate to support Ukraine's independence.

27 May'11

Symfony2 w/PHP5.3 on Ubuntu 11.04 / Nginx

sudo apt-get install php5
sudo apt-get install php5-suhosin


try_files $uri $uri/ /index.php;
location ~ \.php(/.*)?$ {
 fastcgi_split_path_info ^(.+\.php)(.*)$;
 fastcgi_pass   backend;
 fastcgi_index  index.php;
 fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
 include fastcgi_params;
 fastcgi_param  QUERY_STRING     $query_string;
 fastcgi_param  REQUEST_METHOD   $request_method;
 fastcgi_param  CONTENT_TYPE     $content_type;
 fastcgi_param  CONTENT_LENGTH   $content_length;
 fastcgi_intercept_errors        on;
 fastcgi_ignore_client_abort     off;
 fastcgi_connect_timeout 60;
 fastcgi_send_timeout 180;
 fastcgi_read_timeout 180;
 fastcgi_buffer_size 128k;
 fastcgi_buffers 4 256k;
 fastcgi_busy_buffers_size 256k;
 fastcgi_temp_file_write_size 256k;
 #error_page  404              /404.html;

 location /web/ {
 root /var/www/;
 allow all;

Restart Nginx

ps -ax | grep nginx
kill 1021
sudo /etc/init.d/nginx restart

Install PHP-FPM:

sudo apt-get install php5-fpm
sudo /etc/init.d/php5-fpm restart

Install SqLite:

sudo apt-get install php5-sqlite
sudo /etc/init.d/php5-fpm restart

Install internationalization tools:

sudo apt-get install php5-intl


sudo apt-get install php5-intl php-pear
sudo /etc/init.d/php5-fpm restart
sudo pecl install apc

Add date.datetime for your zone and turn shorthand tag mode off:

sudo vim php.ini

You’re done!

sudo /etc/init.d/php5-fpm restart