centos php安装配置,centos上php的安装、配置与扩展

一、安装

php的代码会用到好多库,运行configure查看您的机器上缺少哪些库,用yum指令安装上就可以编译过了。

yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

yum install libxml2-devel -y

yum install openssl openssl-devel -y

yum install curl-devel -y

yum install libjpeg-devel -y

yum install libpng-devel -y
yum install freetype-devel -yyum install openldap -y

yum install openldap-devel -y

cp -frp /usr/lib64/libldap* /usr/lib/

wget http://hk1.php.net/get/php-5.5.11.tar.bz2/from/this/mirror

'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/share/mysql/' '--with-openssl' '--enable-fpm' '--with-mysqli=/usr/bin/mysql_config' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir' '--enable-xml' '--disable-rpath' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-ldap' '--with-ldap-sasl' '--with-xmlrpc' '--enable-zip' '--enable-soap'

make ; make install;

二、配置

修改配置文件(/usr/local/php5/etc/php-fpm.conf)

[global]

pid = run/php-fpm.pid

[www]

user = nobody

group = nobody

listen = 127.0.0.1:9000

pm = dynamic

pm.max_children = 5

pm.start_servers = 2

pm.min_spare_servers = 1

pm.max_spare_servers = 3

三、扩展

./pecl install mongo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值