Skip to main content

Posts

Showing posts from September 22, 2017

Deploying PHP along with Nginx using php-fpm & FastCGI

Some times you have a requirement to run php in an APP server having Nginx and uWSGI configured. If uwsgi is already running with a plugin , then it will be difficult to enable php along with uwsgi. You have to install the uwsgi-plugin-php and after that install another uwsgi from compiling uwsgi source with php plugin. But if we install php-fpm then it will be more easy to do this task. First install the necessary packages for this: >> sudo apt-get install php7.0-dev libphp7.0-embed php-fpm php-curl if you are planning to use mysql and db then also install  php7 . 0 - mysql After that you have to Configure the PHP Processor: Open the php-fpm configuration file: >> vi /etc/php/7.0/fpm/php.ini Change the value of cgi.fix_pathinfo from 1 to 0 This is an extremely insecure setting because it tells PHP to attempt to execute the closest file it can find if the requested PHP file cannot be found. This basically would allow users to craft P