Speed up your development environment PHP + Nginx + Fedora + PG

  • 2,561 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,561
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
9
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Speed up your development environmentPHP + Nginx + Fedora + PG Marcus Sá Developer | Woompa marcus.m.sa@gmail.com @sa_vini
  • 2. Scenario ● Ruby developer ● PHP is the customers requirement● Development environment not installed ● Very tight deadline (O RLY?)
  • 3. Decisions taken ● Avoid complexity* ● Use PHP to develop● Install environment: PHP PostgreSQL, Nginx , ● Using a CMS (Joomla will take care)
  • 4. Avoid complexity* ● Develop the minimum possible● Use modules and components already made ● Focus on the important things
  • 5. Installing environment ● Update your system ● Install Nginx ● Install PHP ● Install PostgreSQL ● Configure Nginx
  • 6. Update your system $ yum update
  • 7. Install NginxInstalling nginx$ yum install nginxSet it to start on boot$ chkconfig nginx onStart right now!$ service nginx start sudo if needed
  • 8. Configure Nginxserver { server_name www.example.com example.com; root /srv/www/www.example.com/public_html; location / { index index.html index.htm; } location ~ .php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:53217; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }}
  • 9. Install PHPinstall packages required for PHP-FastCGI$ yum install php spawn-fcgiSet it to start on boot$ chkconfig spawn-fcgi onStart right now!$ service spawn-fcgi start sudo if needed
  • 10. Configure PHPediting spawn-fcgi$ nano /etc/sysconfig/spawn-fcgiFASTCGI_USER=nginxFASTCGI_GROUP=nginxSOCKET=/var/run/spawn-fcgi.sockPIDFILE=/var/run/spawn-fcgi.pidPHP5_SOCKET=/var/run/php-fcgi.sockCHILDREN=6PHP5=/usr/bin/php-cgiMODE=0600OPTIONS="-s $PHP5_SOCKET -S -M $MODE -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP-f $PHP5" sudo if needed
  • 11. Install PostgreSQLDownload ithttp://www.enterprisedb.com/Make executable$ chmod +x postgre_file.binExecute and install$ ./postgre_file.bin sudo if needed
  • 12. Thats all folks Thanks!