lnmp php源码在哪,在Linux系统中对LNMP源代码安装后添加php和nginx模块

在工作生产中以前的同事搭建了LNMP环境,可是在安装的过程中发现有好多php和nginx的模块没有安装,现在如果全部重新安装怕服务器不稳定,所以只有一个一个的添加没有安装的模块了。今天我就给大家演示一下如何添加没有安装的模块,希望对大家有帮助。

1.首先安装LNMP环境

2.安装php没有安装的模块

[root@RedHat1 php-5.3.27]# cd ext/mbstring/      --进入模块的目录

[root@redhat1 mbstring]# /usr/local/php-5.3.27/bin/phpize  --生成配置文件

Configuring for:

PHP Api Version:        20090626

Zend Module Api No:      20090626

Zend Extension Api No:  220090626

[root@redhat1 mbstring]# make  --编译

[root@redhat1 mbstring]# cp -a modules/mbstring.so /usr/local/php-5.3.27/ext/    --自己当前目录下modules有一个模块复制到php的安装目录中去

[root@redhat1 mbstring]# cd /usr/local/php-5.3.27/ext/

[root@redhat1 ext]# ll

total 2896

-rwxr-xr-x. 1 root root 2965328 Dec 12 10:30 mbstring.so

[root@redhat1 ext]# vim ../etc/php.ini    --打开php配置文件添加以下两行

extension_dir = "/usr/local/php-5.3.27/ext/"

extension=mbstring.so

3.测试安装是否成功

0220161370c6449d2dcc2405cbb7cad1.png

注:以上图片上传到红联Linux系统教程频道中。

4.安装nginx没有安装的模块

[root@redhat1 sbin]# ./nginx -V    --查看nginx安装模块的信息

nginx version: nginx/1.3.13

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

configure arguments: --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre/ --with-openssl=/usr/local/openssl/ --without-http_upstream_ip_hash_module --without-http_upstream_least_conn_module --without-http_upstream_keepalive_module --with-http_stub_status_module --add-module=/home/samba/ngx_cache_purge-2.1

[root@redhat1 sbin]# cd /home/samba/nginx-1.3.13

[root@redhat1 nginx-1.3.13]# ./configure --help |grep rewrite

--without-http_rewrite_module      disable ngx_http_rewrite_module

[root@redhat1 nginx-1.3.13]# ./configure --without-http_rewrite_module

[root@redhat1 nginx-1.3.13]# make            --编译源代码

[root@redhat1 nginx-1.3.13]# echo $?        --是否出错

0

[root@redhat1 nginx-1.3.13]# ll objs/      --以下有一个新的nginx服务

total 2676

-rw-r--r--. 1 root root  35818 Dec 12 11:27 Makefile

drwxr-xr-x. 3 root root    4096 Dec  2 14:01 addon

-rw-r--r--. 1 root root  13979 Dec 12 11:27 autoconf.err

-rwxr-xr-x. 1 root root 2630916 Dec 12 11:28 nginx

-rw-r--r--. 1 root root    5253 Dec 12 11:28 nginx.8

-rw-r--r--. 1 root root    5613 Dec 12 11:27 ngx_auto_config.h

-rw-r--r--. 1 root root    657 Dec 12 11:27 ngx_auto_headers.h

-rw-r--r--. 1 root root    3586 Dec 12 11:27 ngx_modules.c

-rw-r--r--. 1 root root  20444 Dec 12 11:28 ngx_modules.o

drwxr-xr-x. 8 root root    4096 Dec  2 09:36 src

[root@redhat1 nginx-1.3.13]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old1

[root@redhat1 nginx-1.3.13]# cp -a objs/nginx /usr/local/nginx/sbin/  --新nginx服务替换老的nginx

[root@redhat1 nginx-1.3.13]# cd /usr/local/nginx/sbin/

[root@redhat1 sbin]# ll

total 7984

-rwxr-xr-x. 1 root  root  2630916 Dec 12 11:28 nginx

-rwxr-xr-x. 1 nginx nginx 2748622 Dec  2 13:12 nginx.old

-rwxr-xr-x. 1 nginx nginx 2788770 Dec  2 14:01 nginx.old1

[root@redhat1 sbin]# ./nginx -V  --查看只有一个模块了

nginx version: nginx/1.3.13

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

configure arguments: --without-http_rewrite_module

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值