<p><strong><span style="color:rgb(85, 85, 85);">1</span><span style="color:rgb(85, 85, 85);">、确认搭建</span><span style="color:rgb(85, 85, 85);">LAMP</span><span style="color:rgb(85, 85, 85);">所需的环境是否已经安装</span><span style="color:rgb(85, 85, 85);">:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost ~]#rpm -q make gcc gcc-c++ zlib-devel libtool libtool-ltdl libtool-ltdl-devel bisonncurses-devel</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">备注</span><span style="color:rgb(85, 85, 85);">:</span><span style="color:rgb(85, 85, 85);">安装</span><span style="color:rgb(85, 85, 85);">libpng</span><span style="color:rgb(85, 85, 85);">时需要</span><span style="color:rgb(85, 85, 85);">zlib-devel</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">          </span><span style="color:rgb(85, 85, 85);">安装</span><span style="color:rgb(85, 85, 85);">php</span><span style="color:rgb(85, 85, 85);">时需要</span><span style="color:rgb(85, 85, 85);">libtool</span><span style="color:rgb(85, 85, 85);">、</span><span style="color:rgb(85, 85, 85);">libtool-ltdl</span><span style="color:rgb(85, 85, 85);">、</span><span style="color:rgb(85, 85, 85);">libtool-ltdl-devel</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">          </span><span style="color:rgb(85, 85, 85);">安装</span><span style="color:rgb(85, 85, 85);">mysql</span><span style="color:rgb(85, 85, 85);">时需要</span><span style="color:rgb(85, 85, 85);">bison</span><span style="color:rgb(85, 85, 85);">、</span><span style="color:rgb(85, 85, 85);">ncurses-devel</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">2</span><span style="color:rgb(85, 85, 85);">、如果没安装则</span><span style="color:rgb(85, 85, 85);">yum</span><span style="color:rgb(85, 85, 85);">安装</span><span style="color:rgb(85, 85, 85);">:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost~]#yum -y install make gcc gcc-c++ zlib-devel libtool libtool-ltdllibtool-ltdl-devel bison ncurses-devel</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">3</span><span style="color:rgb(85, 85, 85);">、由于要使用编译安装,所以查看</span><span style="color:rgb(85, 85, 85);">httpd</span><span style="color:rgb(85, 85, 85);">、</span><span style="color:rgb(85, 85, 85);">mysql</span><span style="color:rgb(85, 85, 85);">、</span><span style="color:rgb(85, 85, 85);">php</span><span style="color:rgb(85, 85, 85);">是否安装</span><span style="color:rgb(85, 85, 85);">:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost ~]#rpm -q httpd mysql php</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">如果安装则卸载</span><span style="color:rgb(85, 85, 85);">:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost ~]#rpm -e httpd --nodeps</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost ~]#rpm -e mysql --nodeps</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhost ~]#rpm -e php --nodeps</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);"> </span></strong></p><p><strong><span style="color:rgb(0, 176, 80);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">编译安装过程介绍:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">       1</span><span style="color:rgb(85, 85, 85);">)解压</span><span style="color:rgb(85, 85, 85);">tar.gz</span><span style="color:rgb(85, 85, 85);">为后缀的压缩软件包:</span><span style="color:rgb(85, 85, 85);">LAMP</span><span style="color:rgb(85, 85, 85);">环境搭建所需要的每个软件的软代码文件,都是以</span><span style="color:rgb(85, 85, 85);">tar.gz</span><span style="color:rgb(85, 85, 85);">或</span><span style="color:rgb(85, 85, 85);">.tgz</span><span style="color:rgb(85, 85, 85);">提供给我们的打包压缩文件,所以我们必须将其解压再解包。命令如下:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">       tar–zxvf *.tar.gz</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">       2</span><span style="color:rgb(85, 85, 85);">)在</span><span style="color:rgb(85, 85, 85);">linux</span><span style="color:rgb(85, 85, 85);">系统中源代码包安装过程:</span><span style="color:rgb(85, 85, 85);">LAMP</span><span style="color:rgb(85, 85, 85);">环境搭建所需要的软件都是使用</span><span style="color:rgb(85, 85, 85);">C</span><span style="color:rgb(85, 85, 85);">语言开发的,所以安装源代码文件最少需要配置、编译和安装三个步骤</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">       </span><span style="color:rgb(85, 85, 85);">配置(</span><span style="color:rgb(85, 85, 85);">configure</span><span style="color:rgb(85, 85, 85);">)、编译(</span><span style="color:rgb(85, 85, 85);">make</span><span style="color:rgb(85, 85, 85);">)、安装(</span><span style="color:rgb(85, 85, 85);">makeinstall</span><span style="color:rgb(85, 85, 85);">)</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">4</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">libxml2</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf libxml2-2.6.30.tar.gz </span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd libxml2-2.6.30 </span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostlibxml2-2.6.30]# ./configure --prefix=/usr/local/libxml2</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibxml2-2.6.30]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibxml2-2.6.30]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">5</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">libmcrypt</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf libmcrypt-2.5.8.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd libmcrypt-2.5.8</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostlibmcrypt-2.5.8]# ./configure --prefix=/usr/local/libmcrypt </span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibmcrypt-2.5.8]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibmcrypt-2.5.8]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">6</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">zlib</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf zlib-1.2.3.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd zlib-1.2.3</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostzlib-1.2.3]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">(用</span><span style="color:rgb(227, 108, 10);">64</span><span style="color:rgb(227, 108, 10);">位元的方法进行编译)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostzlib-1.2.3]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostzlib-1.2.3]# make install</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">7</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">libpng</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf libpng-1.2.31.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd libpng-1.2.31</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostlibpng-1.2.31]# ./configure --prefix=/usr/local/libpng \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-shared </span><span style="color:rgb(227, 108, 10);">(建立共享库使用的</span><span style="color:rgb(227, 108, 10);">GNU</span><span style="color:rgb(227, 108, 10);">的</span><span style="color:rgb(227, 108, 10);">libtool</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibpng-1.2.31]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlibpng-1.2.31]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">8</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">jpeg</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf jpegsrc.v6b.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd jpeg-6b</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# mkdir /usr/local/jpeg                    </span><span style="color:rgb(227, 108, 10);">(</span><span style="color:rgb(227, 108, 10);">创建</span><span style="color:rgb(227, 108, 10);">jpeg</span><span style="color:rgb(227, 108, 10);">软件的安装目录</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/bin            </span><span style="color:rgb(227, 108, 10);">(创建存放命令的目录)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/lib            </span><span style="color:rgb(227, 108, 10);"> </span><span style="color:rgb(227, 108, 10);">(创建</span><span style="color:rgb(227, 108, 10);">jpeg</span><span style="color:rgb(227, 108, 10);">库文件所在目录)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# mkdir /usr/local/jpeg/include      </span><span style="color:rgb(227, 108, 10);">(创建存放头文件目录)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# mkdir -p /usr/local/jpeg/man/man1  </span><span style="color:rgb(227, 108, 10);">(建立存放手册的目录)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostjpeg-6b]# ./configure --prefix=/usr/local/jpeg \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-shared \    </span><span style="color:rgb(227, 108, 10);">(建立共享库使用的</span><span style="color:rgb(227, 108, 10);">GUN</span><span style="color:rgb(227, 108, 10);">的</span><span style="color:rgb(227, 108, 10);">libtool</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-static     </span><span style="color:rgb(227, 108, 10);">   </span><span style="color:rgb(227, 108, 10);">(建立静态库使用的</span><span style="color:rgb(227, 108, 10);">GUN</span><span style="color:rgb(227, 108, 10);">的</span><span style="color:rgb(227, 108, 10);">libtool</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostjpeg-6b]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">执行</span><span style="color:rgb(85, 85, 85);">make</span><span style="color:rgb(85, 85, 85);">时如果出现如下错误:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">./libtool --mode=compile gcc-O2  -I. -c ./jcapimin.c</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make: ./libtool: Command notfound</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make: *** [jcapimin.lo] Error 127</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">解决方法:</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">默认已安装</span><span style="color:rgb(255, 0, 0);">libtool</span><span style="color:rgb(255, 0, 0);">及</span><span style="color:rgb(255, 0, 0);">libtool-ltdl-devel</span><span style="color:rgb(255, 0, 0);">(如需帮助请看过程</span><span style="color:rgb(255, 0, 0);">2</span><span style="color:rgb(255, 0, 0);">)</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostjpeg-6b]# find / -name config.sub</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">/usr/share/libtool/config/config.sub</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostjpeg-6b]# find / -name config.guess</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">/usr/share/libtool/config/config.guess</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostjpeg-6b]# cp -vRp /usr/share/libtool/config/config.sub .</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostjpeg-6b]# cp -vRp /usr/share/libtool/config/config.guess .</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">也就是把</span><span style="color:rgb(255, 0, 0);">libtool</span><span style="color:rgb(255, 0, 0);">里面的两个配置文件拿来覆盖掉</span><span style="color:rgb(255, 0, 0);">jpeg-6b</span><span style="color:rgb(255, 0, 0);">目录下的对应文件</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">make clean </span><span style="color:rgb(255, 0, 0);">再重新</span><span style="color:rgb(255, 0, 0);">configure</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">9</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">freetype</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf freetype-2.3.5.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd freetype-2.3.5</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostfreetype-2.3.5]# ./configure --prefix=/usr/local/freetype \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-shared    </span><span style="color:rgb(227, 108, 10);">(建立共享库使用的</span><span style="color:rgb(227, 108, 10);">GUN</span><span style="color:rgb(227, 108, 10);">的</span><span style="color:rgb(227, 108, 10);">libtool</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostfreetype-2.3.5]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostfreetype-2.3.5]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">10</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">autoconf</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf autoconf-2.61.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd autoconf-2.61</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostautoconf-2.61]# ./configure</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostautoconf-2.61]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostautoconf-2.61]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">11</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">GD</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf gd-2.0.35.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd gd-2.0.35</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostgd-2.0.35]# ./configure --prefix=/usr/local/gd \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-zlib=/usr/local/zlib/ \      </span><span style="color:rgb(227, 108, 10);">(指定</span><span style="color:rgb(227, 108, 10);">zlib</span><span style="color:rgb(227, 108, 10);">库文件的位置)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-jpeg=/usr/local/jpeg/ \    </span><span style="color:rgb(227, 108, 10);">(指定</span><span style="color:rgb(227, 108, 10);">jpeg</span><span style="color:rgb(227, 108, 10);">库文件的位置)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-png=/usr/local/libpng/ \  </span><span style="color:rgb(227, 108, 10);">(指定</span><span style="color:rgb(227, 108, 10);">png</span><span style="color:rgb(227, 108, 10);">库文件的位置)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-freetype=/usr/local/freetype/     </span><span style="color:rgb(227, 108, 10);">(指定</span><span style="color:rgb(227, 108, 10);">freetype</span><span style="color:rgb(227, 108, 10);">字体库的位置)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostgd-2.0.35]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostgd-2.0.35]# make install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">执行</span><span style="color:rgb(85, 85, 85);">make</span><span style="color:rgb(85, 85, 85);">时如果出现如下错误:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make[2]: *** [gd_png.lo] Error 1</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make[2]: Leaving directory`/usr/src/linux/gd-2.0.35'</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make[1]: *** [all-recursive]Error 1</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make[1]: Leaving directory`/usr/src/linux/gd-2.0.35'</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">make: *** [all]  Error 2</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">解决方法:</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostgd-2.0.35]# find / -name gd_png.c</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">/usr/src/linux/gd-2.0.35/gd_png.c</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostgd-2.0.35]# find / -name png.h</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">/usr/local/libpng/include/png.h</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhostgd-2.0.35]# vi /usr/src/linux/gd-2.0.35/gd_png.c</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">将</span><span style="color:rgb(255, 0, 0);">#include "png.h"    </span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">改为</span><span style="color:rgb(255, 0, 0);">#include "/usr/local/libpng/include/png.h"    </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">12</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">apache</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf httpd-2.2.9.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd httpd-2.2.9</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhosthttpd-2.2.9]# ./configure --prefix=/usr/local/apache \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">> --enable-so \       </span><span style="color:rgb(227, 108, 10);">(以动态共享对象编译)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-rewrite  </span><span style="color:rgb(227, 108, 10);">(基于规则的</span><span style="color:rgb(227, 108, 10);">URL</span><span style="color:rgb(227, 108, 10);">操控)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# make install</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">将</span><span style="color:rgb(227, 108, 10);">apache</span><span style="color:rgb(227, 108, 10);">加入开机启动↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# cp -vRp /usr/local/apache/bin/apachectl /etc/init.d/httpd</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# chmod +x /etc/init.d/httpd </span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">添加</span><span style="color:rgb(227, 108, 10);">apache</span><span style="color:rgb(227, 108, 10);">服务↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# chkconfig --add httpd</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# chkconfig --level 2345 httpd on</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhosthttpd-2.2.9]# service httpd start</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">启动服务时</span><span style="color:rgb(85, 85, 85);">,</span><span style="color:rgb(85, 85, 85);">如果出现如下错误:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">httpd: Could not reliablydetermine the server's fully qualified domain name, using localhost.localdomainfor ServerName</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">解决方法:</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhosthttpd-2.2.9]# vi /usr/local/apache/conf/httpd.conf</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">添加上:</span><span style="color:rgb(255, 0, 0);">ServerName localhost:80</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">执行</span><span style="color:rgb(85, 85, 85);">chkconfig</span><span style="color:rgb(85, 85, 85);">时</span><span style="color:rgb(85, 85, 85);">,</span><span style="color:rgb(85, 85, 85);">如果出现如下错误:</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">service httpd does not supportchkconfig</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">解决方法:</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">[root@localhosthttpd-2.2.9]# vi /etc/rc.d/init.d/httpd</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">在文件第二行加入</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">#chkconfig:2345 10 90</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">#description:Activates/DeactivatesApache Web Server</span></strong></p><p><strong><span style="color:rgb(255, 0, 0);">保存后再执行</span><span style="color:rgb(255, 0, 0);">chkconfig</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">13</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">mysql</span><span style="color:rgb(85, 85, 85);">(最新版本都需要</span><span style="color:rgb(85, 85, 85);">cmake</span><span style="color:rgb(85, 85, 85);">编译安装</span><span style="color:rgb(85, 85, 85);">)</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">编译安装</span><span style="color:rgb(85, 85, 85);"> cmake</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf cmake-2.8.7.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd cmake-2.8.7</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostcmake-2.8.7]# ./bootstrap</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostcmake-2.8.7]# gmake</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostcmake-2.8.7]# gmake install</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">编译安装</span><span style="color:rgb(85, 85, 85);"> MySQL5.5.20</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostcmake-2.8.7]# groupadd mysql</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostcmake-2.8.7]# useradd -g mysql mysql</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf mysql-5.5.15.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd mysql-5.5.15</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostmysql-5.5.15]#</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \           </span><span style="color:rgb(227, 108, 10);">(安装根目录)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">> -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \   </span><span style="color:rgb(227, 108, 10);">(</span><span style="color:rgb(227, 108, 10);">UNIX socket</span><span style="color:rgb(227, 108, 10);">文件)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DDEFAULT_CHARSET=utf8 \     </span><span style="color:rgb(227, 108, 10);">(默认字符集)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DDEFAULT_COLLATION=utf8_general_ci \  </span><span style="color:rgb(227, 108, 10);">(默认编码)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DWITH_EXTRA_CHARSETS=utf8,gbk \         </span><span style="color:rgb(227, 108, 10);">(额外的编码)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \</span><span style="color:rgb(227, 108, 10);">(启用</span><span style="color:rgb(227, 108, 10);">PERFSCHEMA</span><span style="color:rgb(227, 108, 10);">引擎支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DWITH_FEDERATED_STORAGE_ENGINE=1 \   </span><span style="color:rgb(227, 108, 10);">(启用</span><span style="color:rgb(227, 108, 10);">FEDERATED</span><span style="color:rgb(227, 108, 10);">引擎支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">> -DWITH_PARTITION_STORAGE_ENGINE=1\     </span><span style="color:rgb(227, 108, 10);">(启用</span><span style="color:rgb(227, 108, 10);">PARTITION</span><span style="color:rgb(227, 108, 10);">引擎支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DWITH_ARCHIVE_STORAGE_ENGINE=1 \         </span><span style="color:rgb(227, 108, 10);">(启用</span><span style="color:rgb(227, 108, 10);">ARCHIVE</span><span style="color:rgb(227, 108, 10);">引擎支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DWITH_READLINE=1 \</span><span style="color:rgb(227, 108, 10);">(使用</span><span style="color:rgb(227, 108, 10);">readline</span><span style="color:rgb(227, 108, 10);">功能)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DMYSQL_DATADIR=/usr/local/mysql/data \  </span><span style="color:rgb(227, 108, 10);">(数据库数据目录)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>-DMYSQL_TCP_PORT=3306                              </span><span style="color:rgb(227, 108, 10);">(</span><span style="color:rgb(227, 108, 10);">TCP/IP</span><span style="color:rgb(227, 108, 10);">端口)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql-5.5.15]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql-5.5.15]# make install</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql-5.5.15]# cp -vRp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">修改配置文件↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql-5.5.15]# vi /etc/my.cnf</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">     basedir=/usr/local/mysql</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">     datadir=/usr/local/mysql/data</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">     log-error=/usr/local/mysql/data/error.log</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">     pid-file=/usr/local/mysql/data/mysql.pid</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">初始化数据库文件↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql-5.5.15]# /usr/local/mysql/scripts/mysql_install_db \</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">>--defaults-flie=/etc/my.cnf \</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">> --basedir=/usr/local/mysql/\</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">>--datadir=/usr/local/mysql/data \</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">>--pid-file=/usr/local/mysql/data/mysql.pid \</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">> --user=mysql</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">权限设置↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chown -R root .</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chown -R mysql data</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chgrp -R mysql .</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">将</span><span style="color:rgb(227, 108, 10);">mysql</span><span style="color:rgb(227, 108, 10);">加入开机启动↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# cp -vRp support-files/mysql.server /etc/init.d/mysqld</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chmod +x /etc/init.d/mysqld</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">添加</span><span style="color:rgb(227, 108, 10);">mysql</span><span style="color:rgb(227, 108, 10);">服务↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chkconfig --add mysqld</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# chkconfig --level 345 mysqld on</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# service mysqld start</span></strong></p><p><strong><span style="color:rgb(227, 108, 10);">配置</span><span style="color:rgb(227, 108, 10);">mysql</span><span style="color:rgb(227, 108, 10);">↓</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# bin/mysql</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">mysql> deletefrom mysql.user where Host!='localhost'; </span><span style="color:rgb(227, 108, 10);">(只留允许本机登录的帐号)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">mysql> flushprivileges;  </span><span style="color:rgb(227, 108, 10);">(刷新授权表)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">mysql> setpassword for 'root'@'localhost'=password('123456');  </span><span style="color:rgb(227, 108, 10);">(设置用户密码)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">mysql> exit</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostmysql]# bin/mysql -h localhost -u root -p123456 </span><span style="color:rgb(227, 108, 10);">(登录</span><span style="color:rgb(227, 108, 10);">mysql</span><span style="color:rgb(227, 108, 10);">)</span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);"> </span></strong></p><p><strong><span style="color:rgb(85, 85, 85);">14</span><span style="color:rgb(85, 85, 85);">、编译安装</span><span style="color:rgb(85, 85, 85);">php</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# tar -zxvf php-5.3.19.tar.gz</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostlinux]# cd php-5.3.19</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">[root@localhostphp-5.3.19]# ./configure --prefix=/usr/local/php \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-apxs2=/usr/local/apache/bin/apxs \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-mysql=/usr/local/mysql/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-libxml-dir=/usr/local/libxml2/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-png-dir=/usr/local/libpng/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-jpeg-dir=/usr/local/jpeg/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-freetype-dir=/usr/local/freetype/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">> --with-gd=/usr/local/gd/\</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-mcrypt=/usr/local/libmcrypt/ \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--with-mysqli=/usr/local/mysql/bin/mysql_config \</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">> --enable-soap\                  </span><span style="color:rgb(227, 108, 10);">(变量激活</span><span style="color:rgb(227, 108, 10);">SOAP</span><span style="color:rgb(227, 108, 10);">和</span><span style="color:rgb(227, 108, 10);">web services</span><span style="color:rgb(227, 108, 10);">支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-mbstring=all \    </span><span style="color:rgb(227, 108, 10);">(使多字节字符串支持)</span></strong></p><p><strong><span style="color:rgb(0, 112, 192);">>--enable-sockets    </span><span style="color:rgb(227, 108, 10);">            </span><span style="color:rgb(227, 108, 10);">(变量激活</span><span style="color:rgb(227, 108, 10);">socket</span><span style="color:rgb(227, 108, 10);">通讯特性)</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# make</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# make install</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# cp -vRp php.ini-development /etc/php.ini</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# vi /usr/local/apache/conf/httpd.conf</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">添加上:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">    AddType application/x-httpd-php .php</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# service httpd stop</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# service httpd start</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">[root@localhostphp-5.3.19]# vi /usr/local/apache/htdocs/phpinfo.php</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">添加内容为:</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);"><?php</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">       phpinfo();</span></strong></p><p><strong><span style="color:rgb(0, 176, 80);">?></span></strong></p><p>
</p>

linux 下 lamp 编译安装 20160424 szx相关推荐

  1. OpenCV在Linux下的编译安装(Ubuntu )

    OpenCV在Linux下的编译安装(Ubuntu ) 1.先安装相关的库: sudo apt-get install build-essential sudo apt-get install lib ...

  2. linux apache 安装 rewrite,linux下单独编译安装Apache rewrite_module

    Redhat linux下单独编译安装Apache rewrite_module Apache已经编译安装完了,今天弄了个lifebox,装完后发现必须得用rewrite,所以就给它装了个~~ 找到a ...

  3. Linux下Nginx编译安装后的开机自启动设置

    Linux下Nginx编译安装后的开机自启动设置 一.查看当前Nginx启动状态 二.而配置Nginx相关服务文件 三 .设置nginx命令 四.设置开机启动 五.测试开机启动 一.查看当前Nginx ...

  4. Linux下Nginx编译安装过程详解

    Linux下Nginx编译安装过程详解 一.Nginx介绍 二.Nginx源码下载 1.打开Nginx官网 2.下载官网的源码包 三.Nginx源码安装 1.解压源码包 2.安装开发包组及环境 3.编 ...

  5. linux nginx编译详解,Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备 1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码 代码如下:# ...

  6. Linux下nginx编译安装,重新添加模块

    Linux下nginx编译安装,重新添加模块 前言:编译完成后的Nginx,当我们需要新的功能模块时,要怎么重新添加呢?可以按照下面的方法试试. 1.查看nginx版本以及编译安装模块 [root@# ...

  7. linux下nginx编译安装

    转载自: http://hanqunfeng.iteye.com/blog/697696 一.下载nginx 下载地址:http://www.nginx.org/ 选择nginx-0.8.36 将该下 ...

  8. Linux下Boost编译安装

    Boost库是一个可移植.提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一. Boost库由C++标准委员会库工作组成员发起,其中有些内容有望成为下一代C++标准库内容.在C+ ...

  9. C++ Boost在Windows和Linux下的编译安装

    再debian下直接apt-get install gcc g++就可以了.按照类似的逻辑,再Fedora下yum install gcc g++ 报告无法找到g++包. 差了一下,原来这个包的名字叫 ...

  10. linux下软件编译安装 前提和方式

    在linux系统中,如果要用源代码包进行编译安装,就需要用到gcc这个工具,一般安装系统时默认选择都有这个工具包.可以用命令rpm -qa | grep gcc来看看是否安装gcc. 源代码包安装一般 ...

最新文章

  1. react native 组件之switch组件的用法
  2. JS无法获取display为none的隐藏元素的宽度和高度的解决方案
  3. crontab -e
  4. python模块之paramiko学习二
  5. 2011年值得注意的5个设计趋势
  6. javaScript命名规范
  7. Servlet的学习之web路径问题
  8. 如何解决高并发,秒杀问题 1
  9. javaio_java------io基础(一)
  10. 小程序图片上传formdata boundary + base64
  11. 王者荣耀战力查询微信小程序源码下载支持安卓苹果微信Q等多区查询
  12. 点击地图出现导航php,在H5页面中,通过地址打开高德地图以实现导航
  13. 文件夹下载器案例实战
  14. 寄存器 SRAM DRAM存储单元区别
  15. 《Python代码审计》(1)一款超好用的代码扫描工具
  16. Redis 惰性删除
  17. php simplexmlelement object 数组,php中将SimpleXMLElement Object数组转化为普通数组
  18. graphite安装笔记
  19. 基于SSM实现企业生资源管理系统-ERP系统
  20. 永信至诚蔡晶晶:用有温度的技术培育信息时代的安全感

热门文章

  1. php——三篇夯实根基第三篇
  2. 性能常识 [踩坑总结] nf_conntrack: table full, dropping packet [新]
  3. 国土导弹光学反狙击探测系统行业调研报告 - 市场现状分析与发展前景预测(2021-2027年)
  4. “窗体”工具栏控件和“控件工具箱”控件基础
  5. 广电物联网大赛正式开启
  6. 半自动ORM与全自动ORM框架有什么区别?
  7. 简单教程-word2vec处理英文语料
  8. 8月国内搜索引擎市场份额:360搜索上涨至18.23%
  9. 职业规划-《你的降落伞是什么颜色》书中的精髓:如何挖掘自我优势,找到心仪的工作?
  10. 2018NOIOJ网站入门题表(大礼包汇总,更新ing)