ngnix + php-fpm 安装

本文详细介绍了如何从零开始搭建PHP运行环境,包括安装必要的依赖库、配置PHP及其扩展模块、安装Memcached缓存系统以及Nginx服务器等步骤。通过本教程,读者可以学会如何为PHP应用程序创建一个完整的运行环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

yum install libxml2-devel
yum install bzip2-devel
yum install curl-devel
yum install libmcrypt
yum install libmcrypt-devel
yum install postgresql-devel

5.2
./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --with-pgsql --with-curl --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-xml --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-xslt --enable-memcache --enable-zip --with-pcre-regex

5.3
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --with-pgsql --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex

ldconfig -p | grep ltdl //发现存在,所以已安装,只是因为名字的关系,找不到
cd /usr/lib
ln -s libltdl.so.3.1.4 libltdl.so
ldconfig
make clean
make
make install

cd /usr/local/php/bin
yum install autoconf
./pecl install memcache

yum install libevent-devel

#./configure --prefix=/usr/local/libevent
./configure --prefix=/usr/local/memcached  //安装memcached

/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root

yum -y install pcre-devel
./configure --prefix=/usr/local/nginx --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module
make & make install

ln -s /usr/local/nginx/conf /etc/nginx
yum install mysql-devel

./configure --with-php-config=/usr/local/php/bin/php-config
cp mysql.so /usr/lib/php/modules/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值