centos65安装nginx和php

yum -y install gcc automake autoconf libtool make cmake

yum -y install gcc gcc-c++ glibc glibc-devel
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel 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

tar -xvzf php-5.6.13.tar.gz
cd php-5.6.13

./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
make
make test
make install
cd /usr/local/php/
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf
运行php-fpm
/usr/local/php/sbin/php-fpm即可

cd
tar -xvzf pcre-8.36.tar.gz
tar -xvzf openssl-1.0.2a.tar.gz
tar -xvzf zlib-1.2.8.tar.gz
tar nginx-1.9.0.tar.gz
cd nginx-1.9.0
./configure  --prefix=/usr/local/nginx  --with-stream  --with-stream_ssl_module  --with-pcre=/root/pcre-8.36  --with-zlib=/root/zlib-1.2.8  --with-openssl=/root/openssl-1.0.2a  --with-http_ssl_module --with-http_sub_module  --with-http_realip_module  --with-http_stub_status_module --with-http_sub_module

在/usr/local/nginx/conf/nginx.conf
 location ~ \.php$ {
            root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }

在/usr/local/nginx/html/下新建t.php
cat t.php
<?php
    phpinfo();
?>

http://192.168.11.110/t.php

时间: 2024-10-23 06:37:38

centos65安装nginx和php的相关文章

编译安装Nginx

############## 安装OpenSSL ######################wget https://www.openssl.org/source/openssl-1.0.2l.tar.gztar zxvf openssl-1.0.2l.tar.gzcd openssl-1.0.2l/./config --prefix=/opt/local/openssl :make && sudo make install ################ 安装PCRE #######

centos7编译安装nginx

linux及nginx版本 CentOS Linux release 7.2.1511 nginx-1.11.9 第一步安装依赖包 [[email protected] ~]# yum -y install pcre pcre-devel gcc openssl openssl-devel 第二步创建nginx用户 [[email protected] ~]# useradd nginx -s /sbin/nologin -M 第三部进入下载的nginx目录下编译 [[email protect

配置LANMP环境(5)-- 安装NGINX与配置

安装nginx yum install nginx 若提示找不到nginx,则在软件源中添加nginx的软件源文件: vim /etc/yum.repos.d/nginx.repo 添加如下内容: [nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/ gpgcheck=0 enabled=1 在根目录中创建data文件夹,在data文件夹中创建nginx文件夹,里面放置ngin

CentOS下安装Nginx

1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境.  gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++  PCRE PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库.nginx的http模块使用pcre来解析正则表达式,所以需要在linux上安装pc

003.安装nginx(lnmp)

一.下载nginx 下载nginx源码包,解压: [[email protected] ~]# cd /usr/local/src/ [[email protected] src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz[[email protected] src]# tar zxvf nginx-1.6.2.tar.gz [[email protected] src]# cd nginx-1.6.2 二.安装nginx [[emai

今天用pro安装nginx+php+mysql出现问题的解决方法

今天用pro安装nginx+php+mysql出现问题的解决方法 by 伍雪颖 dyld: Library not loaded: @@[email protected]@/openssl/1.0.1h/lib/libcrypto.1.0.0.dylib Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Reason: image not found 解决方法:重装openssl Starting MySQL . ERR

CentOS7 安装 Nginx 1.12.1

安装准备: nginx 依赖的一些 lib 库: yum install gcc-c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--devel 安装 Nginx 检查一下安装已有的 nginx find -name nginx 如果系统安装了Nginx,那么卸载 yum remove nginx 然后开始安装,首先进入 /usr/local 目录 cd /usr/loc

安装nginx 配置虚拟主机

nginx安装 #查看操作系统版本 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) #查看内核版本和64位还是32位 [[email protected] ~]# uname -a Linux master1 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Li

一键安装nginx脚本

#!/bin/bash . /etc/init.d/functions #安装依赖包 yum -y install pcre-devel openssl-devel #创建相关目录,并下载nginx软件包 [ ! -d /application ] && mkdir -p /application [ ! -d /server/tools ] && mkdir -p /server/tools cd /server/tools wget http://nginx.org/d