Centos php 安装


php 安装


1) 添加 yum 源

追加CentOS 6.5的epel及remi源。

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

以下是CentOS 7.0的源。

# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm


yum install php-fpm php-mysql php-mbstring

3)配置 /etc/php-fpm.d/www.conf,由于使用nginx

listen.owner = nginx
listen.group = nginx
listen.mode = 0666

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx


mkdir /var/lib/php/session
chown nginx:nginx /var/lib/php/session


[root@host server]# service php-fpm start

(转载本站文章请注明作者和出处 mylater

Show Disqus Comments

Post Directory