Last active
July 30, 2018 22:22
-
-
Save nghuuphuoc/7766669 to your computer and use it in GitHub Desktop.
Install PHP 5 on Centos 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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