LNMP-install-log
mysql
mysql5.6.24
cmake .
Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
这个错误
ubuntu 就使用 apt-get install libncurses5-dev 安装
再删除 CMakeCache.txt
继续执行cmake .
来生成make file文件
make && make install
安装数据库初始文件
cd /usr/local/mysql
useradd mysql
chown -R mysql:mysql /usr/local/mysql
chmod 0777 /usr/local/mysql
scripts/mysql_install_db 安装数据库
配置service
cp /support-files/mysql.server /etc/init.d/mysql
cp my.cnf /etc/my.cnf
修改/etc/my.cnf
[mysql] #这个是给mysql客户端用的 让他知道socket文件再哪里
socket = /usr/local/mysql/data/zhangcheng.sock
[mysqld] #必备的配置
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
server_id = 1
socket = /usr/local/mysql/data/zhangcheng.sock
pid_file=/usr/local/mysql/data/zhangcheng_mysql.pid
user=mysql #设置启动用户 这样才有权限
nginx 需要使用lua才这样
---------------------------
1 luajit安装
wget -c http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar xzvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make install PREFIX=/usr/local/luajit
echo "/usr/local/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf
ldconfig #这一步 要稍等会 等待系统设置好共享动态库
#注意环境变量!
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
2 nginx configure 选项
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --without-http-cache --with-http_ssl_module --with-http_gzip_static_module --add-module=../ngx_devel_kit-0.2.18/ --add-module=../lua-nginx-module-0.8.6/
apt-get update
安装pcre
apt-get install libpcre3 libpcre3-dev
yum -y install pcre*
安装ssl
apt-get install openssl libssl-dev
yum -y install openssl*
apt-get install curl libcurl3 libcurl3-dev
-----------------------------------------------------------
php
--------------------------------------------------------
libxml2
apt-get install libxml2 libxml2-dev
libpng
cd libpng-1.2.31
./configure --prefix=/usr/local/libpng/
make
make install
jpeg6
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man/man1
cd jpeg-6b
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make
make install
freetype
cd freetype-2.3.5
./configure --prefix=/usr/local/freetype/
make && make install
libmcrypt
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt/
make && make install
cd libltdl 在libmcrypt-2.5.8目录里面
./configure --enable-ltdl-install
make
make install
安装zlib 为了phar不报错
zlib-1.2.3.tar.gz
./configure
make
make install
-----------php5.5 需要gd2.1.0的库
gd2
cd gd-2.0.35
vi gd_png.c
修改include "png.h" 为"/usr/local/libpng/include/png.h"
./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype --with-png=/usr/local/libpng/
make make install
gd2.1.0
cmake -D CMAKE_INSTALL_PREFIX=/usr/local/gd2.1 ENABLE_PNG=ON ENABLE_JPEG=ON ENABLE_FREETYPE=ON .
cmake . -LH 查看有哪些编译选项
make make install
libxpm libxpm-dev 头文件和库也要更新和安装
--php5.4.41--------configure选项
./configure --with-config-file-path=/usr/local/php/php.ini --enable-fpm --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-zip --enable-mbstring=all --enable-sockets --with-zlib-dir=/usr/local
pdo_mysql 5.4之后就使用的是mysqlnd 配置参数 --with-pdo-mysql=mysqlnd
不用单独下载pdo_mysql扩展包了
PHP5.6
./configure --prefix=/root/app/php/php-5.6.16 --with-config-file-path=/root/app/php/php-5.6.16/php.ini --enable-fpm --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-jpeg-dir=/usr/local/jpeg9 --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-zip --enable-mbstring=all --with-curl --enable-sockets --with-zlib-dir=/usr/local
./configure --prefix=/home/zc/lnmp/php/php-5.6.16 --with-config-file-path=/home/zc/lnmp/php/php-5.6.16/etc/php.ini --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-static --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --enable-calendar --enable-bcmath --enable-soap --with-zlib --with-iconv --with-gd --with-xmlrpc --enable-mbstring --with-curl --enable-ftp --with-mcrypt=/usr/local/libmcrypt --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg9 --with-png-dir=/usr/local/libpng --disable-ipv6 --disable-debug --disable-maintainer-zts --disable-fileinfo
cp php.ini-development /usr/local/php/php.ini
cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
cp sapi/fpm/php-fpm /usr/local/bin
vim /usr/local/etc/php-fpm.conf
user = www
group = www
启动php-fpm
/usr/local/bin/php-fpm
使nginx支持php
vim /usr/local/nginx/conf/nginx.conf
user www;
location / {
root html;
index index.php index.html index.htm;
}
location ~* \.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx
创建测试文件
rm /usr/local/nginx/html/index.html
echo "" >> /usr/local/nginx/html/index.php
访问localhost
----------------------------------------------------------