Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
Last active July 30, 2018 22:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nghuuphuoc/7766669 to your computer and use it in GitHub Desktop.
Save nghuuphuoc/7766669 to your computer and use it in GitHub Desktop.
Install PHP 5 on Centos 6
// Install remi repos
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
// Install PHP and other extensions:
$ yum --enablerepo=remi,remi-test install php php-devel php-gd php-mbstring php-mysqlnd php-pdo php-xml
// Install php-mcrypt
$ rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
$ yum --enablerepo=rpmforge install libmcrypt libmcrypt-devel
$ yum --enablerepo=remi,remi-test install php-mcrypt
// Install PHP-FPM
$ yum --enablerepo=remi,remi-test install php-fpm
// Run php-frpm when system starts
$ chkconfig --add php-fpm
$ chkconfig --levels 235 php-fpm on
// Start/stop php-fpm
$ /etc/init.d/php-fpm start
// or
$ service php-fpm start
$ sudo nano /etc/php.ini
date.timezone = 'America/New_York'
upload_max_filesize = 10M
post_max_size = 10M
// Don't forget to restart php-fpm
$ service php-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment