Install LNMP source code in Linux and add the php and nginx modules

Source: Internet
Author: User

During work and production, my colleagues set up the LNMP environment. However, many php and nginx modules were not installed during the installation process. If you reinstall them all, the server may be unstable, therefore, only modules that are not installed are added one by one. Today, I will show you how to add modules that are not installed and hope to help you.

1. First install the LNMP Environment
See:
2. Install modules not installed in php
[Root @ RedHat1 php-5.3.27] # cd ext/mbstring/-- enter the Module Directory
[Root @ redhat1 mbstring] #/usr/local/php-5.3.27/bin/phpize -- generate the configuration file
Processing ing:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
[Root @ redhat1 mbstring] # make -- compile
[Root @ redhat1 mbstring] # cp-a modules/mbstring. so/usr/local/php-5.3.27/ext/-- under your current directory, modules has a module copied to the php installation directory
[Root @ redhat1 mbstring] # cd/usr/local/php-5.3.27/ext/
[Root @ redhat1 ext] # ll
Total 2896
-Rwxr-xr-x. 1 root 2965328 Dec 12 10:30 mbstring. so
[Root @ redhat1 ext] # vim ../etc/php. ini -- open the php configuration file and add the following two lines
Extension_dir = "/usr/local/php-5.3.27/ext /"
Extension = mbstring. so

3. test whether the installation is successful.

4. Install modules not installed on nginx
[Root @ redhat1 sbin] #./nginx-V -- View nginx installation module information
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 -- 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 -- compile source code
[Root @ redhat1 nginx-1.3.13] # echo $? -- Error?
0
[Root @ redhat1 nginx-1.3.13] # ll objs/-- there is a new nginx service below
Total 2676
-Rw-r --. 1 root 35818 Dec 12 11: 27 Makefile
Drwxr-xr-x. 3 root 4096 Dec 2 14:01 addon
-Rw-r --. 1 root 13979 Dec 12 :27 autoconf. err
-Rwxr-xr-x. 1 root 2630916 Dec 12 :28 nginx
-Rw-r --. 1 root 5253 Dec 12 :28 nginx.8
-Rw-r --. 1 root 5613 Dec 12 :27 ngx_auto_config.h
-Rw-r --. 1 root 657 Dec 12 11: 27 ngx_auto_headers.
-Rw-r --. 1 root 3586 Dec 12 :27 ngx_modules.c
-Rw-r --. 1 root 20444 Dec 12 11: 28 ngx_modules.
Drwxr-xr-x. 8 root 4096 Dec 2 09:36 src
[Root @ redhat1 nginx-1.3.13] # mv/usr/local/nginx/sbin/nginx. old1
[Root @ redhat1 nginx-1.3.13] # cp-a objs/nginx/usr/local/nginx/sbin/-- replace old nginx with the new nginx Service
[Root @ redhat1 nginx-1.3.13] # cd/usr/local/nginx/sbin/
[Root @ redhat1 sbin] # ll
Total 7984
-Rwxr-xr-x. 1 root 2630916 Dec 12 :28 nginx
-Rwxr-xr-x. 1 nginx 2748622 Dec 2 nginx. old
-Rwxr-xr-x. 1 nginx 2788770 Dec 2 nginx. old1
[Root @ redhat1 sbin] #./nginx-V -- check that there is only one module.
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.