一 LNMP简介
LAMP服务器是 Linux,apache,mysql,php组合的一个php运行环境。
二 LNMP安装配置
[root@beta1818-db002 soft]# ls -l
总用量 64036
-rw-r--r--. 1 root root 1016391 2月 13 2014 apr-1.5.0.tar.gz
-rw-r--r--. 1 root root 874462 2月 13 2014 apr-util-1.5.3.tar.gz
-rw-r--r--. 1 root root 6068021 11月 20 2013 cmake-2.8.12.1.tar.gz
-rw-r--r--. 1 root root 6747087 2月 13 2014 httpd-2.4.7.tar.gz
-rw-r--r--. 1 root root 23774015 12月 4 2013 mysql-5.5.15.tar.gz
-rw-r--r--. 1 root root 3734873 2月 10 2015 openssl-0.9.8ze.tar.gz
-rw-r--r--. 1 root root 5265809 2月 10 2015 openssl-1.0.2.tar.gz
-rw-r--r--. 1 root root 1790055 2月 13 2014 pcre-8.32.tar.gz
-rw-r--r--. 1 root root 16280142 12月 4 2013 php-5.5.5.tar.gz
[root@beta1818-db002 soft]#
yum install gcc gcc++ libxml2-devel
yum install libXpm-devel
yum -y install ncurses-devel
来自 <http://www.cnblogs.com/xiaoit/p/3994092.html>
tar -xvf apr-1.5.0.tar.gz
cd apr-1.5.0
./configure --prefix=/home/lamp/apr1_5_0
make
make install
cd ../
tar -xvf apr-util-1.5.3.tar.gz
cd apr-util-1.5.3
./configure --prefix=/home/lamp/apr-util-1_5_3 --with-apr=/home/lamp/apr1_5_0/
make
make install
cd ../
tar -xvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/home/lamp/pcre
make
make install
cd ../
tar -xvf httpd-2.4.7.tar.gz
cd httpd-2.4.7
./configure --prefix=/home/lamp/httpd --with-apr=/home/lamp/apr1_5_0 --with-apr-util=/home/lamp/apr-util-1_5_3 --with-pcre=/home/lamp/pcre --enable-so
make
make install
cd ../
tar -xvf cmake-2.8.12.1.tar.gz
cd cmake-2.8.12.1
./configure --prefix=/home/lamp/cmake
make
make install
cd ../
useradd mysql
tar -xvf mysql-5.5.15.tar.gz
cd mysql-5.5.15
/home/lamp/cmake/bin/cmake\
-DCMAKE_INSTALL_PREFIX=/home/lamp/mysql \
-DMYSQL_DATADIR=/home/lamp/mysql/data \
-DSYSCONFDIR=/home/lamp/mysql
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1
make
make install
cd ../
[root@beta1818-db002 mysql]# cp /home/soft/mysql-5.5.15/support-files/my-medium.cnf /home/lamp/mysql/my.cnf
scripts/mysql_install_db --user=mysql --basedir=/home/lamp/mysql --datadir=/home/lamp/mysql/data
cp /home/lamp/mysql/support-files/mysql.server /home/lamp/mysql/bin/
/home/lamp/mysql/bin/mysql.server start
tar -xvf freetype-2.3.11.tar.gz
cd freetype-2.3.11
./configure --prefix=/home/lamp/freetype
make
make install
cd ../
tar -xvf gettext-0.17.tar.gz
cd gettext-0.17
./configure --prefix=/home/lamp/gettext
make
make install
cd ../
tar -xvf libpng-1.2.49.tar.gz
cd libpng-1.2.49
./configure --prefix=/home/lamp/libpng
make
make install
cd ../
tar -xvf jpeg-6b.tar.gz
cd jpeg/src
./configure --prefix=/home/lamp/jpeg --enable-shared
make
mkdir /home/lamp/jpeg/man/man1 -p
mkdir /home/lamp/jpeg/bin -p
mkdir -p /home/lamp/jpeg/include/
mkdir -p /home/lamp/jpeg/lib/
make install
cd ../../
tar -xvf gd-2.0.35.tar.gz
cd gd/2.0.35/
./configure --prefix=/home/lamp/gd --with-png --with-freetype --with-jpeg
make
make install
cd ../../
tar -xvf libgd-2.1.0.tar.gz
cd libgd-2.1.0
./configure --prefix=/home/lamp/libgd --with-jpeg=/home/lamp/jpeg --with-freetype=/home/lamp/freetype --with-png=/home/lamp/libpng --enable-shared
make
make install
cd ../
tar -xvf php-5.5.5.tar.gz
cd php-5.5.5
./configure --prefix=/home/lamp/php --enable-sockets --enable-mbstring --enable-bcmath --with-apxs2=/home/lamp/httpd/bin/apxs --with-mysql=/home/mysql --with-mysqli=/home/mysql/bin/mysql_config --with-png-dir=/home/lamp/libpng --with-freetype-dir=/home/lamp/freetype --with-gd=/home/lamp/libgd --with-jpeg-dir=/home/lamp/jpeg/ --with-gettext=/home/lamp/gettext --with-xpm-dir=/usr/lib64/
make
make test
make install
AddType application/x-httpd-php .php .phtml
三 案例 workpress
四 安装问题
1.
/home/soft/lamp/php-5.5.5/ext/gd/gd.c:57:22: 错误:X11/xpm.h:没有那个文件或目录
make: *** [ext/gd/gd.lo] 错误 1
解决办法: libXpm-devel
2
/home/soft/lamp/php-5.5.5/ext/gd/gd.c:1330: undefined reference to `XpmLibraryVersion'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] 错误 1
3.
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
[root@beta1818-db002 src]# cp -rp /usr/share/libtool/config/config.sub .
cp:是否覆盖"./config.sub"? y