Centos php 安装

2019/01/15

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

2)安装需要内容

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