Skip to content

Instantly share code, notes, and snippets.

@viko16
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viko16/1b723ea9fc2581b4c7e9 to your computer and use it in GitHub Desktop.
Save viko16/1b723ea9fc2581b4c7e9 to your computer and use it in GitHub Desktop.

1. Install needed repositories

  • Remi Dependency on CentOS 6 and Red Hat (RHEL) 6

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

  • Remi Dependency on CentOS 5 and Red Hat (RHEL) 5

rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

  • CentOS 6.4/6.3/6.2/6.1/6/5.9 Nginx repository

Create file /etc/yum.repos.d/nginx.repo and add following content to repo file:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

2. Install Nginx, PHP 5.4 and PHP-FPM

yum --enablerepo=remi,remi-test install nginx php-fpm php-common

3. Install PHP 5.4 modules

yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

4. Stop httpd, Start Nginx HTTP server and PHP-FPM

service httpd stop

service nginx start

service php-fpm start

5. Autostart Nginx and PHP-FPM on boot, also stop httpd

chkconfig httpd off

chkconfig --add nginx chkconfig --levels 235 nginx on

chkconfig --add php-fpm chkconfig --levels 235 php-fpm on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment