LNMP最新版配置
nginx1.6.3
nginx
配置文件
nginx.conf.default
mysql 5.7
mysql官网 详细安装
php 5.3.27(没php-fpm气死我了)
PHP 发布了最新稳定版 5.3.3 ,这个版本最大的亮点是内置了 php-fpm ( FastCGI Process Manager SAPI ) 模块,也就是说如果你是 Nginx 用户的话,以后再也不需要去 Php-FPM 官网寻找相应版本的补丁来编译 php 了,直接加上参数 --enable-fpm 就可以了。
官网 下载
1. 函数库
rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
libiconv-devel没有yum源 http://www.gnu.org/software/libiconv/#downloading
mkdir -p /home/syh/tools
cd /home/syh/tools
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
tar -zxf libiconv-1.16
cd libiconv-1.16
./configure --prefix=/usr/local/libiconv
make && make install
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y libmcrypt-devel
yum install -y mhash
yum install -y mcrypt
2. 获取&&配置
./configure \
--prefix=/usr/local/php5.3 \
--with-mysql=/usr/local/mysql \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xm1 \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openss1 \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp
ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib64/
touch ext/phar/phaar.phar
make
排错
make: *** [Makefile:246: sapi/cgi/php-cgi] Error 1
collect2: error: ld returned 1 exit status make: *** [sapi/cli/php] Error 1
vi Makefile
查找 EXTRA_LIBS = ... 在结尾加上-lcrypt -liconv、保存退出
然后make clean 再编译
然后make
make: *** [Makefile:307: ext/phar/phar.php] Error 127
touch ext/phar/phar.phar
make: *** [Makefile:307: ext/phar/phar.php] Error 127
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/
可看https://blog.csdn.net/letmesisi/article/details/89088075?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164692571816780265479579%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=164692571816780265479579&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-89088075.pc_search_result_cache&utm_term=%2Fusr%2Flocal%2Fmysql%2Flib%2Flibmysqlclient.so.18&spm=1018.2226.3001.4187
–with-mysql=mysqlnd 替代–with-mysql=/usr/local/mysql可避免2,3
make: *** [Makefile:243: sapi/cgi/php-cgi] Error 1
yum install *ltdl*
https://www.oicqzone.com/pc/2013012814814.html
https://www.cnblogs.com/fjping0606/p/4760479.html
make: *** [ext/phar/phar.php] Error 127
解决的方法如下:
在里面加上一行
/usr/local/lib
然后运行/sbin/ldconfig
ini
cp php.ini-production /usr/local/php-5.3.27/lib/php.ini
php-fpm.conf
mysqli_coonect
https://www.cnblogs.com/dnoir/p/12072113.html
|