{"id":2158,"date":"2014-05-16T20:47:18","date_gmt":"2014-05-16T16:47:18","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=2158"},"modified":"2014-05-16T20:58:27","modified_gmt":"2014-05-16T16:58:27","slug":"getting-nginx-with-php-and-mysql","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2014\/getting-nginx-with-php-and-mysql\/","title":{"rendered":"Getting nginx with PHP and MySQL"},"content":{"rendered":"<p>I managed to install nginx on my laptop. Apache used to eat a lots of my precious RAM previously. My laptop got a mere 3GB of it :-\/. I hope nginx would make Web Development much more pleasing as well as allowing my laptop to do other stuffs as well.<\/p>\n<p>Installing nginx is not as straight forward as installing the famous LAMP (Linux, Apache, MySQL and PHP). It requires quite some file configuration ninja skills. Following the tutorial found <a href=\"http:\/\/www.howtoforge.com\/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-12.04-lts\" target=\"_blank\">here<\/a>.<\/p>\n<p>It was kinda tricky to config the config file &#8216;\/etc\/nginx\/sites-available\/default&#8217;.<\/p>\n<p>I was un-commenting everything in the curly braces after &#8216;location ~ \\.php$&#8217; like a dummy. nginx would fail to start. After doing <\/p>\n<p><code>$ nginx -t<\/code><\/p>\n<p>It told me:-<br \/>\nnginx: [emerg] &#8220;fastcgi_pass&#8221; directive is duplicate in \/etc\/nginx\/sites-enabled\/default:61<br \/>\nnginx: configuration file \/etc\/nginx\/nginx.conf test failed<\/p>\n<p>After scanning the file and showing some attention to what was going on, i noticed that i was supposed to un-comment only part for &#8216;With php5-fpm&#8217; so as it appears like this<\/p>\n<p><code><br \/>\nlocation ~ \\.php$ {<br \/>\n\t#\tfastcgi_split_path_info ^(.+\\.php)(\/.+)$;<br \/>\n\t#\t# NOTE: You should have \"cgi.fix_pathinfo = 0;\" in php.ini<br \/>\n\t#<br \/>\n\t#\t# With php5-cgi alone:<br \/>\n\t#\tfastcgi_pass 127.0.0.1:9000;<br \/>\n\t#\t# With php5-fpm:<br \/>\n\t\tfastcgi_pass unix:\/var\/run\/php5-fpm.sock;<br \/>\n\t\tfastcgi_index index.php;<br \/>\n\t\tinclude fastcgi_params;<br \/>\n\t}<br \/>\n<\/code><\/p>\n<p>I was feeling too lazy to install phpMyAdmin for database administration. Thought of why not using the command line.<br \/>\n<code><br \/>\n$ mysql -p<br \/>\n<\/code> <\/p>\n<p>The mysql terminal opened.<\/p>\n<p><code>CREATE DATABASE mybb;<\/code><\/p>\n<p>And it worked. I could install the beta version of MyBB Forum software 1.8 \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I managed to install nginx on my laptop. Apache used to eat a lots of my precious RAM previously. My laptop got a mere 3GB of it :-\/. I hope nginx would make Web Development much more pleasing as well as allowing my laptop to do other stuffs as well. Installing nginx is not as &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2014\/getting-nginx-with-php-and-mysql\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Getting nginx with PHP and MySQL<\/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":[1],"tags":[57,61,76,190,81,109,117],"class_list":["post-2158","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-kubuntu","tag-linux","tag-mysql","tag-nginx","tag-php","tag-ubuntu","tag-web-development"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=2158"}],"version-history":[{"count":2,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2158\/revisions"}],"predecessor-version":[{"id":2160,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2158\/revisions\/2160"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=2158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=2158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=2158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}