Code Snippet

Just another Code Snippet site

How To Install Linux, nginx, MySQL, PHP (LEMP) stack on CentOS 6

LEMP stack is a group of open source software to get web servers up and running. The acronym stands for Linux, nginx (pronounced Engine x), MySQL, and PHP. This tutorial explains how to install the required repos to download nginx and php-fpm, how to

/etc/php.ini :

cgi.fix_pathinfo=0

/etc/nginx/nginx.conf :

worker_processes  4;

/etc/nginx/conf.d/default.conf :

    location / {
        root   /usr/share/nginx/html;
        index index.php  index.html index.htm;
    }

    location ~ \.php$ {
        root           /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

/etc/php-fpm.d/www.conf :

user = nginx
group = nginx

Restart all services :

service php-fpm restart
service nginx restart

Source: How To Install Linux, nginx, MySQL, PHP (LEMP) stack on CentOS 6 | DigitalOcean

, ,


Leave a Reply

Your email address will not be published. Required fields are marked *