centos下php相关命令备忘录_嗼淰_新浪博客

一、卸载

查看php版本命令:

#php -v

强制删除

#rpm -qa|grep php

注意卸载要先卸载没有依赖的

pdo是mysql的依赖项;common是gd的依赖项;

 

这个命令是删除不干净的

#yum remove php

二、安装php5.6.9

1.编译前执行下列命令

#添加组

groupadd www

#添加php-fpm用户

useradd -c php-fpm-user -g www -M php-fpm

# c和c++编译器

yum install -y gcc gcc-c++

# PHP扩展依赖

yum install -y libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel openldap-devel

2.编译指令

./configure --prefix=/usr/local/php\

--with-config-file-path=/usr/local/php/etc\

 --with-libdir=lib64\

 --enable-fpm\

 --with-fpm-user=php-fpm\

 --with-fpm-group=www\

 --enable-mysqlnd\

 --with-mysql=mysqlnd\

 --with-mysqli=mysqlnd\

 --with-pdo-mysql=mysqlnd\

 --enable-opcache\

 --enable-pcntl\

 --enable-mbstring\

 --enable-soap\

 --enable-zip\

 --enable-calendar\

 --enable-bcmath\

 --enable-exif\

 --enable-ftp\

 --enable-intl\

 --with-openssl\

 --with-zlib\

 --with-curl\

 --with-gd\

 --with-zlib-dir=/usr/lib\

 --with-png-dir=/usr/lib\

 --with-jpeg-dir=/usr/lib\

 --with-gettext\

 --with-mhash\

 --with-ldap

make && make install

3.编译完一些后续工作

# 设置php-fpm开机自动启动

chmod +x /etc/init.d/php-fpm

chkconfig php-fpm on

cp /data/soft/php/etc/php-fpm.conf.default /data/soft/php/etc/php-fpm.conf

service php-fpm start

编译选项说明

enable-pcntl 进程控制,默认关闭,编译开启

enable-opcache

PHP编译字节码缓存,如果需要将 Xdebug 扩展和 OPcache 一起使用,必须在 Xdebug 扩展之前加载 OPcache 扩展

使用以下配置可使PHP活得较好性能,

opcache.memory_consumption=128

opcache.interned_strings_buffer=8

opcache.max_accelerated_files=4000

opcache.revalidate_freq=60

opcache.fast_shutdown=1

opcache.enable_cli=1

enable-soap 简单对象访问协议,使用xml传输数据,目前已经不常用

enable-zip zip文件处理

enable-calendar 日历处理

enable-bcmath 任意精度数学扩展

enable-exif

exif(可交换图像文件格式),专门为数码相机和照片设定,记录数码照片的属性信息和拍摄数据

Windows 用户必须在 php.ini 中启用 php_mbstring.dll 和 php_exif.dll 扩展。 请确保在 php.ini 中保持正确的顺序: php_mbstring.dll 必须在 php_exif.dll 之前 加载。

enable-intl 国际化支持

enable-mbstring 宽字符支持

with-gettext 语言翻译

with-mhash hash库支持

with-ldap ldap支持

with-libdir=lib64 如果64位操作系统,指定为/usr/lib64为默认库路径

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嗼唸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值