{"id":2277,"date":"2017-05-08T06:17:56","date_gmt":"2017-05-08T06:17:56","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=2277"},"modified":"2018-07-10T05:05:19","modified_gmt":"2018-07-10T05:05:19","slug":"installation-of-php-7-0-fpm-and-nginx","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/05\/08\/installation-of-php-7-0-fpm-and-nginx\/","title":{"rendered":"Installation of PHP 7.0 FPM and NGINX"},"content":{"rendered":"<p>Ref: https:\/\/www.ma-no.org\/en\/content\/index_php7-install-php7-with-nginx-and-memcache-in-ubuntu-14-04_2137.php<\/p>\n<ol>\n<li>Install php7.0-fpm: sudo apt-get install php7.0-fpm\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install php7.0-fpm \r\n...\r\n\r\nCreating config file \/etc\/php\/7.0\/fpm\/php.ini with new version\r\nphp_invoke: Enabled module ctype for fpm sapi\r\nphp_invoke: Enabled module iconv for fpm sapi\r\nphp_invoke: Enabled module opcache for fpm sapi\r\nphp_invoke: Enabled module dom for fpm sapi\r\nphp_invoke: Enabled module gettext for fpm sapi\r\nphp_invoke: Enabled module mysqli for fpm sapi\r\nphp_invoke: Enabled module xsl for fpm sapi\r\nphp_invoke: Enabled module xmlwriter for fpm sapi\r\nphp_invoke: Enabled module sysvshm for fpm sapi\r\nphp_invoke: Enabled module ftp for fpm sapi\r\nphp_invoke: Enabled module mbstring for fpm sapi\r\nphp_invoke: Enabled module xml for fpm sapi\r\nphp_invoke: Enabled module intl for fpm sapi\r\nphp_invoke: Enabled module sockets for fpm sapi\r\nphp_invoke: Enabled module xdebug for fpm sapi\r\nphp_invoke: Enabled module mcrypt for fpm sapi\r\nphp_invoke: Enabled module posix for fpm sapi\r\nphp_invoke: Enabled module sysvsem for fpm sapi\r\nphp_invoke: Enabled module zip for fpm sapi\r\nphp_invoke: Enabled module fileinfo for fpm sapi\r\nphp_invoke: Enabled module readline for fpm sapi\r\nphp_invoke: Enabled module imagick for fpm sapi\r\nphp_invoke: Enabled module shmop for fpm sapi\r\nphp_invoke: Enabled module xmlreader for fpm sapi\r\nphp_invoke: Enabled module curl for fpm sapi\r\nphp_invoke: Enabled module simplexml for fpm sapi\r\nphp_invoke: Enabled module memcache for fpm sapi\r\nphp_invoke: Enabled module calendar for fpm sapi\r\nphp_invoke: Enabled module mysqlnd for fpm sapi\r\nphp_invoke: Enabled module tokenizer for fpm sapi\r\nphp_invoke: Enabled module gd for fpm sapi\r\nphp_invoke: Enabled module sysvmsg for fpm sapi\r\nphp_invoke: Enabled module json for fpm sapi\r\nphp_invoke: Enabled module pdo for fpm sapi\r\nphp_invoke: Enabled module exif for fpm sapi\r\nphp_invoke: Enabled module pdo_mysql for fpm sapi\r\nphp_invoke: Enabled module wddx for fpm sapi\r\nphp_invoke: Enabled module phar for fpm sapi\r\nNOTICE: Not enabling PHP 7.0 FPM by default.\r\nNOTICE: To enable PHP 7.0 FPM in Apache2 do:\r\nNOTICE: a2enmod proxy_fcgi setenvif\r\nNOTICE: a2enconf php7.0-fpm\r\nNOTICE: You are seeing this message because you have apache2 package installed.\r\nphp7.0-fpm start\/running, process 22661<\/pre>\n<p>&nbsp;<\/li>\n<li>CHANGE THE PHP VERSION FOR CLI TO 7.0\n<pre class=\"lang:default decode:true \">sudo ln -sfn \/usr\/bin\/php7.0 \/etc\/alternatives\/php<\/pre>\n<p>CHECK THE PHP VERSION:<\/p>\n<pre class=\"lang:default decode:true \">php -v\r\nPHP 7.0.30-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May  2 2018 12:43:14) ( NTS )\r\nCopyright (c) 1997-2017 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies\r\n    with Zend OPcache v7.0.30-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies\r\n    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans<\/pre>\n<p>&nbsp;<\/li>\n<li>TO ENABLE PHP 7.0 ON NGINX SERVER, PLS DO (MAKE SURE APACHE2 IS STOPPED IF IT&#8217;S RUNNING AND START NGINX):\n<p>THE NGINX MAIN CONFIG IN \/etc\/nginx\/nginx.conf<br \/>\nTHE DEFAULT VIRTUALHOST IN \/etc\/nginx\/sites-available\/default<br \/>\nEDIT IT TO ENABLE PARSING PHP FILE:<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/nginx\/sites-available\/default<\/pre>\n<p>CHANGE THE CONTENT TO ENABLE PHP 7.0 FPM:<\/p>\n<pre class=\"lang:default decode:true\">...\r\nserver {\r\n        ...\r\n        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n\t#\r\n\tlocation ~ \\.php$ {\r\n\t\tinclude snippets\/fastcgi-php.conf;\r\n\t#\r\n\t#\t# With php7.0-cgi alone:\r\n\t#\tfastcgi_pass 127.0.0.1:9000;\r\n\t#\t# With php7.0-fpm:\r\n\t\tfastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;\r\n\t}\r\n\r\n\t# deny access to .htaccess files, if Apache's document root\r\n\t# concurs with nginx's one\r\n\t#\r\n\tlocation ~ \/\\.ht {\r\n\t\tdeny all;\r\n\t}\r\n}\r\n...<\/pre>\n<p>THEN CHANGE PHP7.0-FPM SETTING:<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/php\/7.0\/fpm\/php.ini<\/pre>\n<p>CHANGE THE CONTENT:<\/p>\n<pre class=\"lang:default decode:true\">cgi.fix_pathinfo=0\r\nupload_max_filesize = 2000M -&gt; (default 2M)\r\nmax_file_uploads = 2000 -&gt; (default 20)\r\npost_max_size = 2000M -&gt; (default 8M)\r\nmax_execution_time = 6000 -&gt; (default 30) in second\r\nmax_input_time = 600 -&gt; (default 60) in second\r\nmemory_limit = 2560M -&gt; (default 128M)<\/pre>\n<p>THEN RESTART PHP7.0-FPM SERVICE:<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl restart php7.0-fpm<\/pre>\n<p>CHECK NGINX SYNTAX: sudo nginx -t<br \/>\nRESTART NGINX: sudo systemctl restart nginx<br \/>\nOPEN IT: http:\/\/localhost\/phpinfo.php (NEED TO CLEAR THE BROWSER CACHE FIRST)<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/www.ma-no.org\/en\/content\/index_php7-install-php7-with-nginx-and-memcache-in-ubuntu-14-04_2137.php Install php7.0-fpm: sudo apt-get install php7.0-fpm teddy@teddy-K43SJ:~$ sudo apt-get install php7.0-fpm &#8230; Creating config file \/etc\/php\/7.0\/fpm\/php.ini with new version php_invoke: Enabled module ctype for fpm sapi php_invoke: Enabled module iconv for fpm sapi php_invoke: Enabled module opcache for fpm sapi php_invoke: Enabled module dom for fpm sapi php_invoke: Enabled module gettext for fpm &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/05\/08\/installation-of-php-7-0-fpm-and-nginx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Installation of PHP 7.0 FPM and NGINX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"class_list":["post-2277","post","type-post","status-publish","format-standard","hentry","category-php-2"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=2277"}],"version-history":[{"count":5,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2277\/revisions"}],"predecessor-version":[{"id":2279,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2277\/revisions\/2279"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=2277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=2277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=2277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}