php project development with vagrant
DESCRIPTION
PHP Project development with VagrantTRANSCRIPT
![Page 1: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/1.jpg)
PHP Project development with Vagrant
linux, Nginx, PHP-FPM, Mysql
![Page 2: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/2.jpg)
Vagrant installportable development environments
$ mkdir beykent_sample $ cd beykent_sample $ vagrant init precise32 http://files.vagrantup.com/precise32.box ! Open the Vagrantfile and uncomment line 20: # localhost:8080, Quest machine access port 80 # config.vm.network :forwarded_port, guest: 80, host: 8080 ! Start box $ vagrant up ! ssh into the ssh $ vagrant ssh
![Page 3: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/3.jpg)
Mysql install
$ sudo apt-get update
$ sudo apt-get install mysql-server mysql-client
set root password
open-source relational database management system
![Page 4: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/4.jpg)
Nginx install
$ sudo apt-get install nginx
$ sudo servive nginx start
Nginx is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server
![Page 5: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/5.jpg)
PHP-FPMPHP is the most popular server-side language and it requires minimal set-up
$ sudo apt-get install php5-fpm !
$ sudo vim /etc/php5/fpm/pool.d/www.conf !
Make the following changes listen = /tmp/php5-fpm.sock !
$ sudo service php5-fpm restart
![Page 6: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/6.jpg)
php fpm configration
cgi.fix_pathinfo=0
max_execution_time = 90
display_errors = On
post_max_size = 16M
upload_max_filesize = 16M
default_socket_timeout = 90
$ sudo vim /etc/php5/fpm/php.ini Make the following changes
![Page 7: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/7.jpg)
PHP Popular Bundles install
$ sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache
service php5-fpm restart
Db adapters, caching adapters, etc…
![Page 8: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/8.jpg)
Nginx Configurationserver { listen 80; root /usr/share/nginx/www; index index.php index.html index.html; server_name localhost; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { try_files $uri $uri/ /index.html; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } }
$ sudo vim /etc/nginx/sites-available/default
![Page 9: PHP Project development with Vagrant](https://reader038.vdocuments.net/reader038/viewer/2022100420/554a0e4eb4c9058c5d8b4826/html5/thumbnails/9.jpg)
Test
sudo nano /usr/share/nginx/www/test.php
<?php echo “hello world”; ?>