linux安装lnmp

本文详细介绍了在Linux系统中一步步安装LNMP(Linux, Nginx, MySQL, PHP)环境的过程,包括依赖库的安装、PHP配置、MySQL的安装以及Nginx的配置。通过这个指南,你可以成功搭建起一个运行PHP应用的基础架构。" 115037559,8176824,Unity中using的深度解析,"['Unity开发', 'C#编程', '游戏开发', '代码管理', '资源管理']
摘要由CSDN通过智能技术生成

1 安装PHP-安装Nginx-安装Mysql

yum install -y wget gcc gcc-c++ autoconf libjpeg libjpeg-devel perl perl* perl-CPAN libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers png jpeg autoconf gcc cmake make gcc-c++ gcc ladp ldap* ncurses ncurses-devel zlib zlib-devel zlib-static pcre pcre-devel pcre-static openssl openssl-devel perl libtoolt openldap-devel libxml2-devel ntpdate cmake gd* gd2 ImageMagick-devel jpeg jpeg* pcre-dev* fontconfig libpng libxml2 zip unzip gzip


2

./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt \
--enable-mbstring --disable-pdo --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 --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir --with-openssl


3

groupadd www
useradd -g www www


4


 <?php
echo phpinfo();
?>


5

cp /解压路径/download/php-5.4.29/php.ini-production   /安装路径/php/lib/php.ini

6

kill -USR2 `cat var/run/php-fpm.pid`


7

./configure --prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-pcre=/opt/pcre-8.34 \
--with-zlib=/opt/zlib-1.2.8 \
--with-openssl=/opt/openssl-1.0.1g


8

<?php
echo phpinfo();
?>

9

 location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm index.php; 
   if (!-e $request_filename){
            rewrite  ^/V1/(.*)$  /V1/index.php?s=$1  last;
            }
    }


10


location ~ \.php {
        root   /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;     
   fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }



参考:

http://blog.reetsee.com/archives/296

http://www.ilanni.com/?p=9731

 mysql下载地址:http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.38.tar.gz



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值