<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[国内VPS]CentOS6.2下安装php5.4.0,mysql-5.5.21,nginx-1.0.12的步骤记录，PHP5.4与Apache结合实现上传进度的安装配置，Nginx开机启动自动输入SSL启动密码。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Sat, 26 Mar 2011 14:28:28 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	后期问题<br/>在虚拟机里出现在最后时卡住了，于是排查：按F2，发现两个问题：<br/>问题1:<br/>mounting local filesystem: mount: mount point vmhgfs does not exist<br/>mounting other filesystems: mount: mount&nbsp;&nbsp;point vmhgfs does not exist<br/>问题2：<br/>PHP作为服务启动时老启动不起来，卡了，在最后，只好关闭：chkconfig php-fpm off<br/>统一在脚本里启动：在/etc/init.d# vi lnmp <br/>nohup service&nbsp;&nbsp;php-fpm start &gt; /dev/null 2&gt;&amp;1 &amp;<br/>对Mountain出现不存在的错误屏蔽掉：<br/>/etc# vi fstab<br/>#host://mnt/hgfs vmhgfs defaults,user,ttl=5,uid=root,gid=root,fmask=0113,dmask=0002 0 0<br/>------------------------------------------------------------问题得到解决。<br/><br/>2.0 安装快速备份命令bcp<br/>bcp命令：https://github.com/RickieL/bcp/blob/master/bcp<br/>用于快速备份文件或目录。<br/> wget https://nodeload.github.com/RickieL/bcp/tarball/master -O bcp.tar.gz<br/> tar xzf&nbsp;&nbsp;bcp.tar.gz<br/> cd RickieL-bcp-f65e017<br/> chmod +x bcp<br/> mv bcp /bin/bcp<br/>2.1 备份php.ini配置文件<br/> bcp /usr/local/php5/lib/php.ini<br/>2.2 备份php-fpm.conf配置文件<br/> bcp /usr/local/php5/etc/php-fpm.conf <br/>2.3 备份/etc/init.d/php-fpm 启动文件<br/>&nbsp;&nbsp;&nbsp;&nbsp;bcp /etc/init.d/php-fpm <br/>2.4 备份原来的整个程序目录：<br/> bcp /usr/local/php5<br/><br/>centos5.5安装最新的LNMP：<br/>一、获取相关开源程序：<br/>　　1、【适用CentOS操作系统】利用CentOS Linux系统自带的yum命令安装、升级所需的程序库（RedHat等其他Linux发行版可从安装光盘中找到这些程序库的RPM包，进行安装）：<br/>yum install telnet -y<br/>yum install lrzsz -y<br/>yum install nc -y<br/>yum install unzip -y<br/>yum install wget -y<br/>yum install sudo -y<br/><br/>嵌入式串口相关操作rpm包安装：<br/>yum install setserial<br/>yum install minicom<br/><br/>扯下串口这块的记录：<br/>得到的串口信息:<br/>setserial -a /dev/ttyS0<br/>/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Baud_base: 115200, close_delay: 50, divisor: 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;closing_wait: 3000<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flags: spd_normal skip_test<br/><br/>setserial /dev/ttyS0 port 0x03f8 irq 4 uart 16550A baud_base 9600<br/><br/>设置：<br/>root@192.168.225.128:/home/jackxiang/com# setserial /dev/ttyS0 port 0x03f8 irq 4 uart 16550A baud_base 9600<br/>再看设置成功了没？<br/>root@192.168.225.128:/home/jackxiang/com# setserial -a /dev/ttyS0<br/>/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Baud_base: 9600, close_delay: 50, divisor: 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;closing_wait: 3000<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flags: spd_normal skip_test<br/><br/>其它setserial参数设置：<br/>root@192.168.225.128:/home/jackxiang/c_com# setserial -g /dev/ttyS0<br/>/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4<br/>root@192.168.225.128:/home/jackxiang/c_com#&nbsp;&nbsp;setserial -gb /dev/ttyS0<br/>/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A<br/>root@192.168.225.128:/home/jackxiang/c_com# setserial -g -G /dev/ttyS0<br/>/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 9600 spd_normal skip_test<br/><br/>相关参考：http://phorum.study-area.org/index.php/topic,25440.0.html<br/>http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Serial-HOWTO.html<br/>http://baike.baidu.com/view/245027.htm<br/>关于minicom也就可以在这儿查看以前的记录：http://jackxiang.com/visit.php?job=viewresult&amp;sid=f13e4b9a640d4c80db689fab5db06c16<br/><br/><br/><br/>开始正式安装这个Lnmp：<br/>sudo -s<br/>LANG=C<br/>yum -y install gcc gcc-c++ autoconf 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 openldap openldap-devel nss_ldap openldap-clients openldap-servers<br/><br/>RedHat AS4 系统环境，通常情况下缺少的支持包安装,64位和32位会自动识别：<br/>yum install libjpeg-devel<br/>yum install freetype-devel<br/>yum install libpng-devel<br/><br/><br/><br/>CentOS下MySQL 5.7.9编译安装，安装成功：<br/>https://blog.linuxeye.com/432.html<br/><textarea name="code" class="php" rows="15" cols="100">
cd mysql-5.7.9
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql &#92;
-DMYSQL_DATADIR=/data/mysql &#92;
-DDOWNLOAD_BOOST=1 &#92;
-DWITH_BOOST=../boost_1_59_0 &#92;
-DSYSCONFDIR=/etc &#92;
-DWITH_INNOBASE_STORAGE_ENGINE=1 &#92;
-DWITH_PARTITION_STORAGE_ENGINE=1 &#92;
-DWITH_FEDERATED_STORAGE_ENGINE=1 &#92;
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 &#92;
-DWITH_MYISAM_STORAGE_ENGINE=1 &#92;
-DENABLED_LOCAL_INFILE=1 &#92;
-DENABLE_DTRACE=0 &#92;
-DDEFAULT_CHARSET=utf8mb4 &#92;
-DDE FAULT_COLLATION=utf8mb4_general_ci &#92;
-DWITH_EMBEDDED_SERVER=1

 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=boost -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EMBEDDED_SERVER=1

make -j `grep processor /proc/cpuinfo &#124; wc -l`&nbsp;&nbsp;
make install
</textarea><br/><br/>多行容易有问题，实践一行更好使：<br/><textarea name="code" class="php" rows="15" cols="100"> 
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=../boost_1_59_0&nbsp;&nbsp;-DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1&nbsp;&nbsp;
</textarea><br/><br/>mysql-8.0.0-dmr-Linux-x86_64<br/><textarea name="code" class="php" rows="15" cols="100">
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=./boost/boost_1_60_0/boost/ -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1&nbsp;&nbsp;&nbsp;&nbsp;
</textarea><br/>-- Downloading boost_1_60_0.tar.gz to /data/software/mysql-8.0.0-dmr/boost/boost_1_60_0/boost<br/>-- [download 0% complete]<br/>-- [download 1% complete]<br/>直接不带boost版本的mysql安装包：<br/><textarea name="code" class="php" rows="15" cols="100">
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=../boost_1_60_0 -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1 
</textarea><br/><br/><br/><textarea name="code" class="php" rows="15" cols="100">
make -j `grep processor /proc/cpuinfo &#124; wc -l`&nbsp;&nbsp;
make install
</textarea><br/><br/><br/>安装mysql最新版本：<br/>tar -zxvf cmake-2.8.4.tar.gz <br/>首先，需要下载安装Cmake;<br/>wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz<br/>wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.12.tar.gz/from/http://cdn.mysql.com/<br/>安装cmake;<br/>tar xvzf cmake-2.8.4.tar.gz<br/>./configure<br/>make<br/>make install<br/><br/>http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz<br/><br/>vi /etc/profile<br/>PATH=$PATH:/usr/local/bin/<br/>export PATH<br/><br/><br/>cmake . &#92;<br/>-DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/ &#92;<br/>-DMYSQL_DATADIR=/usr/local/webserver/mysql/data &#92;<br/>-DWITH_INNOBASE_STORAGE_ENGINE=1 &#92;<br/>-DMYSQL_TCP_PORT=3306 &#92;<br/>-DMYSQL_UNIX_ADDR=/usr/local/webserver/mysql/data/mysql.sock &#92;<br/>-DMYSQL_USER=mysql &#92;<br/>-DWITH_DEBUG=0<br/><br/>为了不做软链接编译时就指定mysql.sock到另外的位置：<br/>cmake . &#92;<br/>-DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/ &#92;<br/>-DMYSQL_DATADIR=/usr/local/webserver/mysql/data &#92;<br/>-DWITH_INNOBASE_STORAGE_ENGINE=1 &#92;<br/>-DMYSQL_TCP_PORT=3306 &#92;<br/>-DMYSQL_UNIX_ADDR=/data0/data/mysql.sock &#92;<br/>-DMYSQL_USER=mysql &#92;<br/>-DWITH_DEBUG=0<br/><br/>VPS实践如下：（2014-09-28）<br/>cmake . &#92;<br/>-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ &#92;<br/>-DMYSQL_DATADIR=/data/mysql &#92;<br/>-DWITH_INNOBASE_STORAGE_ENGINE=1 &#92;<br/>-DMYSQL_TCP_PORT=3306 &#92;<br/>-DMYSQL_UNIX_ADDR=/tmp/mysql.sock &#92;<br/>-DMYSQL_USER=mysql &#92;<br/>-DWITH_DEBUG=0<br/>我在编译的时候报错，意思是 DMYSQL_USER=mysql无效，懒得找原因，直接把那个参数给去掉了，接着进行下面的操作；<br/>make &amp;&amp; make install<br/><br/>如果想要加入：Coreseek编译上有区别，且目前版本不能全兼容，试了下：mysql5.5.8是可以的，需要加入参数：-DCMAKE_BUILD_TYPE=Release -DWITH_SPHINX_STORAGE_ENGINE=1<br/>具体请看：http://jackxiang.com/post/4317/ 【可能没法访问，我还没有整理完的缘故】<br/><br/><br/>/usr/sbin/groupadd mysql<br/>/usr/sbin/useradd -g mysql mysql<br/><br/>cp support-files/my-small.cnf /etc/my.cnf<br/>chown mysql:mysql /etc/my.cnf<br/>chown -R mysql:mysql /usr/local/webserver/mysql<br/>切换用户进入安装目录:<br/>su&nbsp;&nbsp;mysql<br/>cd /usr/local/webserver/mysql/scripts<br/>./mysql_install_db<br/>下面技巧实践Ok：<br/>如安装的源代码文件给丢失后，也可以用下面的方法直接初始化Mysql的mysql表，相当于：<br/>/usr/local/webserver/mysql/scripts/mysql_install_db --user=mysql --datadir=/data0/data/ --basedir=/usr/local/webserver/mysql<br/>/usr/local/webserver/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql<br/>出现：[注意：这儿就是指定BaseDir函数的脚本的地方啦]<br/>FATAL ERROR: Could not find ./bin/my_print_defaults<br/>修改：<br/>basedir=&quot;/usr/local/webserver/mysql&quot;<br/>builddir=&quot;/root/software/mysql-5.5.8&quot;<br/>解决方法[上面就是直接修改啦，下面是参数传入罢了]：<br/>/usr/local/webserver/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data &amp;(这点非常重要)<br/><br/>如何修改basedir特别是vps里有两个盘时，把database放到另外一块盘上：<br/>datadir = /data/datadir/mysql<br/>innodb_log_group_home_dir = /data/datadir/mysql<br/><br/>root@*.10.6.23:/usr/local/mysql/bin# ./mysqladmin -umysql shutdown<br/>cp -Rf /usr/local/mysql/var/* /data/datadir/mysql/.<br/><br/>root@*.10.6.23:/usr/local/mysql/bin# service mysql start<br/>Starting MySQL. ERROR! The server quit without updating PID file (/data/datadir/mysql/ZWCLC6X-7198.pid).<br/>MYSQL启动后报：ERROR! The server quit without updating PID file错误的问题解决 <br/>无法启动mysql，后来上网找了一下解决方法，无非就是以下几种<br/><br/>1. 注释/etc/my.cnf里的skip-federated注释掉即#skip-federated；<br/>2. my.cnf文件配置过高，重新定义其中的参数（根据服务器情况定义）；<br/>3. 杀掉mysql_safe和mysqld进程，然后再重启；<br/>4. 当前日志文件过大，超出了my.cnf中定义的大小（默认为64M），删除日志文件再重启； <br/><br/>但是在主机中：<br/><br/>1．&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注释中无skip-federated这个选项<br/>2．&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;My.cnf是自己优化过的，断电之前正常使用，不是这个的问题<br/>3．&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ps –ef &#124; grep mysql&nbsp;&nbsp;根本就没有mysql的僵尸进程<br/>4．&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;没有这个问题<br/>基本上网上的所有方式都试过了，都无法解决问题，然后我就打开了error.log，发现了是磁盘空间不够。<br/>http://bbs.chinaunix.net/forum.php?mod=viewthread&amp;tid=4141403<br/><br/>root@*.10.6.23:/data/datadir# chown -R mysql:root mysql<br/><br/>root@*.10.6.23:/data/datadir# service mysql start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>Starting MySQL.. SUCCESS! <br/><br/><br/>110327&nbsp;&nbsp;3:07:33 InnoDB: Initializing buffer pool, size = 128.0M<br/>110327&nbsp;&nbsp;3:07:33 InnoDB: Completed initialization of buffer pool<br/>在/etc/my.cnf&nbsp;&nbsp;打开下面的InnoDB配置以减少内存即可：<br/>default-storage-engine=MyISAM&nbsp;&nbsp;[注意：Mysql5.6.11放在server-id里不行，还是会报Plugin &#039;InnoDB&#039; is disabled错，要往上挪挪：放socket&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= /data0/data/mysql.sock&nbsp;&nbsp;后就行了。]<br/>server-id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1<br/>innodb_buffer_pool_size = 21M<br/>innodb_additional_mem_pool_size = 2M<br/>innodb_log_file_size = 5M<br/>innodb_log_buffer_size = 8M<br/>innodb_flush_log_at_trx_commit = 1<br/>innodb_lock_wait_timeout = 50<br/><br/>启动：带--user=mysql<br/>/usr/local/webserver/mysql/bin/mysqld_safe --user=mysql &amp; <br/><br/><br/><br/>编译PHP前准备：libiconv PHP Mysql都用得到，不安会出现如下情况<br/>本人在编译php5.2.8时候，make ZEND_EXTRA_LIBS=&#039;-liconv&#039;，出现下列错误提示<br/>ext/gd/libgd/gdkanji.o: In function `do_convert&#039;:<br/>/data0/software/php-5.2.8/ext/gd/libgd/gdkanji.c:350: undefined reference to `libiconv_open&#039;<br/>/data0/software/php-5.2.8/ext/gd/libgd/gdkanji.c:365: undefined reference to `libiconv&#039;<br/>........<br/>........<br/>........<br/>/data0/software/php-5.2.8/ext/iconv/iconv.c:2491: undefined reference to `libiconv_open&#039;<br/>/usr/bin/ld: final link failed: No space left on device<br/>collect2: ld returned 1 exit status<br/>先这样：<br/>wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz<br/>./configure --prefix=/usr/local/libiconv<br/>make;make install<br/>后依旧的话，则再看下：<br/>注意“/usr/bin/ld: final link failed: No space left on device<br/>”，应该是磁盘空间不够所致，果然，我清空了部分内容，顺利通过编译！算是给大家提醒一下，希望大家不要出现下列错误！<br/>最后可能是直接用了make,而不是：make ZEND_EXTRA_LIBS=&#039;-liconv&#039; ...<br/>以上是我在编译：5.3.8版本时发现的，后面编译完后在运行FastCGI时会提示：<br/>Starting php-fpm [eAccelerator] This build of &quot;eAccelerator&quot; was compiled for PHP version 5.3.6. Rebuild it for your PHP version (5.3.8) or download precompiled binaries.<br/>done<br/>于是需要重新编译一次这个缓存插件：<br/>cd eaccelerator-0.9.6.1<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/>还有就是查看php.ini关于eaccelerator的配置：<br/>[eaccelerator]<br/>zend_extension=&quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so&quot;<br/>eaccelerator.shm_size=&quot;128&quot;<br/>eaccelerator.cache_dir=&quot;/usr/local/webserver/eaccelerator_cache&quot;<br/>........<br/>然后根据上面的目录结构中去删除以前版本的缓存即可：<br/>root@116.255.139.240:/usr/local/webserver/eaccelerator_cache# ls<br/>0&nbsp;&nbsp;1&nbsp;&nbsp;2&nbsp;&nbsp;3&nbsp;&nbsp;4&nbsp;&nbsp;5&nbsp;&nbsp;6&nbsp;&nbsp;7&nbsp;&nbsp;8&nbsp;&nbsp;9&nbsp;&nbsp;a&nbsp;&nbsp;b&nbsp;&nbsp;c&nbsp;&nbsp;d&nbsp;&nbsp;e&nbsp;&nbsp;f<br/>root@116.255.139.240:/usr/local/webserver/eaccelerator_cache# rm -Rf *<br/>------------------------------------------------------------------------------------------------------------------------------------<br/>wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz<br/>cd libiconv-1.13.1<br/>./configure --prefix=/usr/local<br/>make<br/>make install<br/>cd ..<br/><br/>http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download<br/>wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz<br/>cd libmcrypt-2.5.8<br/>./configure<br/>make<br/>make install<br/>/sbin/ldconfig<br/>cd libltdl/<br/>./configure --enable-ltdl-install<br/>make<br/>make install<br/>cd ../../<br/><br/>http://sourceforge.net/projects/mhash/files/mhash/<br/>wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz<br/>cd mhash-0.9.9.9<br/>./configure<br/>make<br/>make install<br/>cd ..<br/>ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la<br/>ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so<br/>ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4<br/>ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8<br/>ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a<br/>ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la<br/>ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so<br/>ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2<br/>ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1<br/><br/>http://sourceforge.net/projects/mcrypt/files/MCrypt/<br/>wget http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz<br/>cd mcrypt-2.6.8<br/>/sbin/ldconfig<br/>./configure<br/>make<br/>make install<br/><br/>可能会出现：<br/>=================================================================<br/>configure: error: *** libmcrypt was not found<br/><br/>为了的到mcrypt.so库文件，先后安装编译了mhash和libmcrypt，但是到最后编译mcrypt时报错：<br/><br/>configure: error: *** libmcrypt was not found<br/><br/>最后发现是因为环境变量的问题，gcc编译的时候根据自身定义的变量寻找相关函数库等文件，libmcrypt也是刚安装的，在变量中没有定义出来，所以手动添加：<br/><br/>[root@localhost modules]# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH<br/><br/>再次编译即可。<br/>=================================================================<br/>PHP5.3.9: wget http://cn.php.net/get/php-5.3.9.tar.gz/from/this/mirror<br/>编译PHP：<br/>wget http://cn.php.net/distributions/php-5.3.6.tar.gz<br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl<br/><br/>PHP7.0编译参数：<br/>./configure&nbsp;&nbsp;--prefix=/usr/local/php7.0 --with-config-file-path=/usr/local/php7.0/etc --with-fpm-user=www --with-fpm-group=www --enable-fpm --disable-fileinfo --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif --enable-sysvsem --with-curl --enable-mbregex --enable-inline-optimization --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug&nbsp;&nbsp;--enable-opcache --with-readline<br/>make时还是需要加上iconv那个：make ZEND_EXTRA_LIBS=&#039;-liconv&#039;,否则还是会报错，对于PHP7.0主PHP低的生产版本混合运行，把：<br/>cp /etc/init.d/php-fpm拷贝到自己的home目录下修改一下路径，重新启动，这个脚本的启动参数打印了下，如下：<br/>/usr/local/php7.0/sbin/php-fpm --daemonize --fpm-config /usr/local/php7.0/etc/php-fpm.conf --pid /usr/local/php7.0/var/run/php-fpm.pid<br/><br/>本次新加：<br/>--with-pdo=shared&nbsp;&nbsp;-with-pdo-mysql=/usr/local/webserver/mysql&nbsp;&nbsp;<br/><textarea name="code" class="php" rows="15" cols="100">
./configure&nbsp;&nbsp;--prefix=/usr/local/php7.0 --with-config-file-path=/usr/local/php7.0/etc --with-fpm-user=www --with-fpm-group=www --enable-fpm --disable-fileinfo --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif --enable-sysvsem --with-curl --enable-mbregex --enable-inline-optimization --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --with-gettext --enable-zip --enable-soap --disable-ipv6 --disable-debug&nbsp;&nbsp;--enable-opcache --with-readline &amp;&amp; make ZEND_EXTRA_LIBS=&#039;-liconv&#039; &amp;&amp; make install
</textarea><br/>PHP想在一开始就把PDO编译进去，而不是直接加载PDO.so，在configure时可能会出现一个问题，如下：<br/>checking for MySQL support for PDO... yes<br/>checking for mysql_config... /usr/local/webserver/mysql/bin/mysql_config<br/>checking for mysql_query in -lmysqlclient... no<br/>checking for mysql_query in -lmysqlclient... (cached) no<br/>configure: error: PDO_MYSQL configure failed. Please check config.log for more information.<br/>引起的原因，Centos6.2最小化安装，没有安一个rpm包：mysql-level没有装，或者是mysql的版本不对。但Mysql我是通过源码安装的，于是，可以在目录 /usr/local/webserver/mysql/lib/ 找到以下需要的包，也就是最新的Mysql5.5.20编译好的这些库，如下：<br/>[root@bogon lib]# echo ~+/libmysqlclient.<br/>libmysqlclient.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libmysqlclient.so&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; libmysqlclient.so.18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;libmysqlclient.so.18.0.0<br/>[root@bogon lib]# ls ~+/libmysqlclient.a&nbsp;&nbsp;&nbsp;&nbsp; <br/>/usr/local/webserver/mysql/lib/libmysqlclient.a<br/>export LDFLAGS=-L/usr/local/webserver/mysql/lib/<br/><br/>再次在PHP5.3.10下进行configure时，就不会提示PDO的相关问题了，但问题依旧，难道还是得要单独安装这个PDO模块！！<br/>暂时不安PDO，先把所有用到的都给编译进PHP里去再说，如下：<br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo enable-dom&nbsp;&nbsp; --with-readline --enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session --enable-spl&nbsp;&nbsp;--enable-hash --enable-reflection<br/><br/><br/>出现：configure: error: Please reinstall readline - I cannot find readline.h<br/>解决方法：<br/>yum install readline-devel<br/><br/>但又报错：php&nbsp;&nbsp;configure: error: readline library not found 干脆去掉这一个不常用的项目：<br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo enable-dom&nbsp;&nbsp;--enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session --enable-spl&nbsp;&nbsp;--enable-hash --enable-reflection<br/><br/>就configure通过了：<br/>Thank you for using PHP.<br/><br/>make ZEND_EXTRA_LIBS=&#039;-liconv&#039;<br/><br/>//如果是路径L不对得手动加参数:<br/>make ZEND_EXTRA_LIBS=&#039;-liconv -L/usr/local/lib&#039;<br/><br/>成功...<br/>make install<br/><br/><br/>/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol &#039;ber_strdup&#039;<br/>/usr/bin/ld: note: &#039;ber_strdup&#039; is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line<br/>/lib64/liblber-2.4.so.2: could not read symbols: Invalid operation<br/>collect2: error: ld returned 1 exit status<br/>make: *** [sapi/cli/php] 错误 1<br/>在老外的一篇文章中终于找到解决办法,我是在centos7下进行编译时遇到这个问题的：<br/><br/>-Run your configure command<br/>-edit Makefile<br/>-Find the line that starts with &quot;EXTRA_LIBS =&quot;<br/>-Add the following to the end of the line &quot; -llber&quot;<br/><br/>cp php.ini-dist /usr/local/webserver/php/etc/php.ini<br/>cd ../<br/><br/>刚开始就把SOAP编译进去： <br/>Move into the source directory and configure PHP with SOAP enabled (this may take a few minutes):<br/>cd php-5.2.5<br/>./configure --enable-soap=shared<br/>加上这个：<br/>--enable-soap=shared<br/>加上后是这样：<br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared<br/><br/>make ZEND_EXTRA_LIBS=&#039;-liconv&#039;&nbsp;&nbsp;<br/><br/>PHP5.6.3 2014-11-30 编译成功备案：<br/><textarea name="code" class="php" rows="15" cols="100">
&#039;./configure&#039; &#039;--prefix=/usr/local/php&#039; &#039;--with-config-file-path=/usr/local/php/etc&#039; &#039;--with-mysql=/usr/local/mysql&#039; &#039;--with-mysqli=/usr/local/mysql/bin/mysql_config&#039; &#039;--with-pdo-mysql=/usr/local/mysql&#039; &#039;--with-iconv-dir&#039; &#039;--with-freetype-dir&#039; &#039;--with-jpeg-dir&#039; &#039;--with-png-dir&#039; &#039;--with-zlib&#039; &#039;--with-libxml-dir=/usr&#039; &#039;--enable-xml&#039; &#039;--enable-discard-path&#039; &#039;--enable-magic-quotes&#039; &#039;--enable-safe-mode&#039; &#039;--enable-bcmath&#039; &#039;--enable-shmop&#039; &#039;--enable-sysvsem&#039; &#039;--enable-inline-optimization&#039; &#039;--with-curl&#039; &#039;--enable-mbregex&#039; &#039;--enable-fastcgi&#039; &#039;--enable-fpm&#039; &#039;--enable-force-cgi-redirect&#039; &#039;--enable-mbstring&#039; &#039;--with-mcrypt&#039; &#039;--enable-ftp&#039; &#039;--with-gd&#039; &#039;--enable-gd-native-ttf&#039; &#039;--with-openssl&#039; &#039;--with-mhash&#039; &#039;--enable-pcntl&#039; &#039;--enable-sockets&#039; &#039;--with-xmlrpc&#039; &#039;--enable-zip&#039; &#039;--enable-soap&#039; &#039;--without-pear&#039; &#039;--with-gettext&#039; &#039;--with-mime-magic&#039; &#039;--enable-sysvmsg&#039; &#039;--enable-phar=shared&#039;
</textarea><br/><br/>编译php报错:/usr/bin/ld: cannot find -liconv解决方法：<br/>首先检查libiconv是否有安装，其次，确认libiconv的安装目录为/usr/local，即编译参数<br/>&nbsp;&nbsp;]#./configure --prefix=/usr/local<br/>&nbsp;&nbsp;然后记得更新下库<br/>&nbsp;&nbsp;]#ldconfig<br/>在最后面添加 -liconv :<br/>编辑：<br/>./src/MakeFile文件<br/>将<br/>LIBS = -lm -lexpat -L/usr/local/lib <br/>改成<br/>LIBS = -lm -lexpat -liconv -L/usr/local/lib <br/>vi /etc/ld.so.conf<br/><br/>&nbsp;&nbsp;这样php编译安装就可以正常运行了。<br/><br/>但有时还是会报错的：<br/>&#124;&#124;&#124;&#124;&#124;&#124;PHP的configure没加：--with-iconv=/usr/local/libiconv引发的/usr/bin/ld: cannot find -liconv&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;<br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv=/usr/local/libiconv --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gettext --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --with-snmp --enable-shmop --enable-sysvsem --enable-sysvshm --enable-calendar --enable-inline-optimization --with-curl --with-curlwrappers --enable-exif --enable-sysvmsg --with-mcrypt --with-gd --enable-gd-jis-conv --disable-debug --with-openssl --with-mhash --enable-pcntl --silent --enable-sockets<br/>make <br/>make install<br/>出现的原因是没加：--with-iconv=/usr/local/libiconv ，这个是编译时编译到那儿的：<br/>------------------------------------------------------------------------------------------------------------------------------------------<br/>解决方法：<br/>wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz<br/>tar -zxvf libiconv-1.13.1.tar.gz<br/>cd libiconv-1.13.1<br/>./configure --prefix=/usr/local/libiconv<br/>make<br/>make install<br/>------------------------------------------------------------------------------------------------------------------------------------------<br/>~/software/php-5.3.15# ./configure --help&#124;grep iconv<br/>--without-iconv[=DIR]&nbsp;&nbsp; Exclude iconv support<br/>--with-iconv-dir=DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XMLRPC-EPI: iconv dir for XMLRPC-EPI<br/><br/>--with-iconv-dir:<br/>用于 PHP 编译时指定 iconv 在系统里的路径，否则会扫描默认路径。<br/>--with-iconv:<br/>要激活这个扩展必须在编译时使用[DIR]<br/><br/>&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;&#124;<br/><br/>昨天编译安装PHP的时候make报错，make: *** [sapi/fpm/php-fpm] Error 1<br/>/usr/bin/ld: cannot find -liconv<br/>collect2: ld returned 1 exit status<br/>make: *** [sapi/fpm/php-fpm] 错误 1<br/>上面的方法还是没法解决，最后解决了，直接用make，没有用make ZEND_EXTRA_LIBS=&#039;-liconv&#039;<br/>不再提示cannot find -liconv，而是：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory ,于是按以前的方法，如下：ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.18&nbsp;&nbsp;/usr/lib/ ，再make一下，直接就过去了，Yeath.<br/><br/>原因iconv重复安装在不同目录，造成include文件iconv.h等重复 通过 find / -name “iconv.h” 如果查找到2个以上返回结果，说明 iconv重复安装了，卸载多余的版本即可正常编译。<br/>[root@bogon /]#&nbsp;&nbsp;find / -name &quot;iconv.h&quot;<br/>/usr/local/libiconv/include/iconv.h<br/>/usr/include/iconv.h<br/>果然是这个问题。<br/><br/>安装iconv是源码编译安装，于是到安装目录cd /usr/local/src/libiconv-1.13.1，执行 make uninstall卸载自己安装的版本。再重新安装PHP。<br/><br/><br/>问题1：<br/>You may want to add: /usr/local/webserver/php/lib/php to your php.ini include_path<br/>/root/jackxiang.com/php-5.3.6/build/shtool install -c ext/phar/phar.phar /usr/local/webserver/php/bin<br/>cp: cannot stat `ext/phar/phar.phar&#039;: No such file or directory<br/>[vps实践]linux下安装php5.3.6的扩展包pear :http://jackxiang.com/post/4153/<br/>(1)chmod: cannot access `ext/phar/phar.phar&#039;: No such file or directory:<br/>wget http://pear.php.net/go-pear.phar<br/>[root@localhost phar]# /usr/local/webserver/php/bin/php go-pear.phar <br/>Below is a suggested file layout for your new PEAR installation.&nbsp;&nbsp;To<br/>change individual locations, type the number in front of the<br/>directory.&nbsp;&nbsp;Type &#039;all&#039; to change all of them or simply press Enter to<br/>accept these locations.<br/><br/>1. Installation base ($prefix)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /usr/local/webserver/php<br/>2. Temporary directory for processing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: /tmp/pear/install<br/>3. Temporary directory for downloads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /tmp/pear/install<br/>4. Binaries directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: /usr/local/webserver/php/bin<br/>5. PHP code directory ($php_dir)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /usr/local/webserver/php/lib/php<br/>6. Documentation directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /usr/local/webserver/php/docs<br/>7. Data directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: /usr/local/webserver/php/data<br/>8. User-modifiable configuration files directory : /usr/local/webserver/php/cfg<br/>9. Public Web Files directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: /usr/local/webserver/php/www<br/>10. Tests directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /usr/local/webserver/php/tests<br/>11. Name of configuration file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: /usr/local/webserver/php/etc/pear.conf<br/><br/>1-11, &#039;all&#039; or Enter to continue: all<br/>这个根据个人环境进行修改。(我是直接回车即可)<br/>================================================<br/>(2)chmod: cannot access `ext/phar/phar.phar&#039;: No such file or directory:<br/>make: [ext/phar/phar.phar] Error 1 (ignored)<br/>解决方法1：./configure的时候 要加上--without-pear<br/>然后再make install或者重新make ZEND_EXTRA_LIBS=&#039;-liconv&#039;,Then :make install<br/>解决方法2:<br/>cd ext/phar/. cp ./phar.php phar.phar<br/>问题2：<br/>/root/jackxiang.com/php-5.3.6/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory<br/>make: *** [ext/phar/phar.php] Error 127<br/><br/>ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.18&nbsp;&nbsp;/usr/lib/<br/><br/>PHP扩展：<br/>memcache：<br/>http://pecl.php.net/package/memcache<br/>wget http://pecl.php.net/get/memcache-3.0.6.tgz<br/>tar zxvf memcache-3.0.6.tgz<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/>cd ../<br/><br/>eaccelerator：<br/>wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2<br/>tar jxvf eaccelerator-0.9.6.1.tar.bz2 <br/>cd eaccelerator-0.9.6.1<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/>cd ../<br/>PDO_MYSQL：<br/>http://pecl.php.net/package/PDO_MYSQL<br/>wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz<br/>tar zxvf PDO_MYSQL-1.0.2.tgz<br/>cd PDO_MYSQL-1.0.2<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql<br/>make<br/>make install<br/>cd ../<br/><br/>ImageMagick:<br/>wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz<br/>tar zxvf ImageMagick.tar.gz<br/>cd ImageMagick-6.6.8-8<br/>./configure<br/>make<br/>make install<br/><br/>imagick:[依赖前面的ImageMagick，注意顺序]<br/>wget http://pecl.php.net/get/imagick-3.1.0b1.tgz<br/>tar -zxvf imagick-3.1.0b1.tgz <br/>cd imagick-3.1.0b1<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/>cd ../<br/><br/><br/>修改php.ini文件：<br/>cd /root/jackxiang.com/php-5.3.6<br/>cp ./php.ini-production /usr/local/webserver/php/etc/php.ini<br/><br/>手工修改：查找/usr/local/webserver/php/etc/php.ini中的extension_dir = &quot;./&quot;<br/>修改为extension_dir = &quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/&quot;<br/>//各种PHP版本的extension_dir是不一样的！！！<br/>并在此行后增加以下几行，然后保存：<br/>extension = &quot;memcache.so&quot;<br/>extension = &quot;pdo_mysql.so&quot;<br/>extension = &quot;imagick.so&quot;<br/><br/>再查找output_buffering = Off<br/>修改为output_buffering = On<br/>[eaccelerator]<br/>zend_extension=&quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so&quot;<br/>eaccelerator.shm_size=&quot;128&quot;<br/>eaccelerator.cache_dir=&quot;/usr/local/webserver/eaccelerator_cache&quot;<br/>eaccelerator.enable=&quot;1&quot;<br/>eaccelerator.optimizer=&quot;1&quot;<br/>eaccelerator.check_mtime=&quot;1&quot;<br/>eaccelerator.debug=&quot;0&quot;<br/>eaccelerator.filter=&quot;&quot;<br/>eaccelerator.shm_max=&quot;0&quot;<br/>eaccelerator.shm_ttl=&quot;300&quot;<br/>eaccelerator.shm_prune_period=&quot;120&quot;<br/>eaccelerator.shm_only=&quot;0&quot;<br/>eaccelerator.compress=&quot;1&quot;<br/>eaccelerator.compress_level=&quot;9&quot;<br/><br/><br/>安装Nginx：<br/>wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.zip<br/>tar zxvf pcre-7.8.tar.gz<br/>cd pcre-8.12<br/>./configure<br/>make &amp;&amp; make install<br/>cd ../<br/><br/>wget http://nginx.org/download/nginx-0.9.6.tar.gz<br/>wget http://nginx.org/download/nginx-1.0.2.tar.gz<br/>cd nginx-0.9.6<br/>./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module<br/>make &amp;&amp; make install<br/>cd ../<br/>启动nginx：<br/>/usr/local/webserver/nginx/sbin/nginx&nbsp;&nbsp;-c /usr/local/webserver/nginx/conf/nginx.conf<br/><br/>如果需要添加Nginx_HTTP_Push_Module长连接模块，需要加入新选项，/root/software/nginx_http_push_module-0.692是下载的模块文件位置：<br/> --add-module=/root/software/nginx_http_push_module-0.692<br/> ./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module&nbsp;&nbsp;--add-module=/root/software/nginx_http_push_module-0.692<br/><br/><br/>自己加入安全模块的编译选项：<br/>./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --add-module=/root/software/nginx_http_push_module-0.692 --add-module=/root/software/ngx_cache_purge-1.3&nbsp;&nbsp;--with-http_secure_link_module<br/><br/>目前最新生产环境的版本：<br/>wget http://nginx.org/download/nginx-1.0.8.tar.gz 这儿新加了一个模块：--with-http_mp4_module<br/>./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --add-module=/root/software/nginx_http_push_module-0.692 --add-module=/root/software/ngx_cache_purge-1.3&nbsp;&nbsp;--with-http_secure_link_module --with-http_mp4_module<br/><br/><br/><br/><br/>编译：<br/>make;make install<br/><br/><br/>配置nginx.conf:<br/>&nbsp;&nbsp;error_page 519 /519.html;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($request_uri ~* &quot;(cost&#92;()&#124;(concat&#92;()&quot;) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 519;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($request_uri ~* &quot;[+&#124;(%20)]union[+&#124;(%20)]&quot;) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 519;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($request_uri ~* &quot;[+&#124;(%20)]and[+&#124;(%20)]&quot;) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 519;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($request_uri ~* &quot;[+&#124;(%20)]select[+&#124;(%20)]&quot;) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 519;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/><br/>还有乱七八糟的一些扩展参考：<br/>configure arguments: --prefix=/home/nginx --with-pcre --add-module=../ngx_http_consistent_hash --add-module=../ngx_max_connections --add-module=../ngx_cache_purge --add-module=../ngx_mp4_streaming_public --with-cc-opt=-O3 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --without-http_memcached_module --without-http_fastcgi_module --with-google_perftools_module<br/>编译过程中几个注意事项：<br/>1、必须采用--with-pcre，而不要偷懒采用--without-http_rewrite_module，否则配置文件里将不支持if判断；<br/>2、加载mp4_streaming，必须采用--with-cc-opt=-O3方式进行编译。<br/>3、max_connections模块默认支持nginx最新版本是0.8.32，需要vi修改其DIR，然后path -p0，但千万不要看见有个Makefile就执行make &amp;&amp; make install了，因为它会毫无道理的把整个nginx安装到当前目录的.nginx下隐藏起来……<br/><br/>最新安装nginx-1.1.0全编译项目配置如下：<br/>./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module&nbsp;&nbsp; --add-module=/root/software/nginx_http_push_module-0.692&nbsp;&nbsp; --add-module=/root/software/ngx_cache_purge-1.3<br/><br/><br/><br/>在linux下安装Nginx的Pcre包的时候,有时候提示<br/>configure: error: newly created file is older than distributed files!<br/>Check your system clock<br/>出现此编译错误，请检查你的系统时间是否设置有误。。。<br/>查看硬件日期时间<br/>hwclock -show<br/>linux是每隔一段时间将系统时间写入 硬件bois的 如果刚设置完了就关机,开机后时间还是等于没有设置<br/># date -s 991128<br/>Sun Nov 28 00:00:00 CST 1999<br/>实例：设置时间伟2008年8月8号12:00<br/># date -s “2008-08-08 12:00:00″<br/>修改完后,记得输入:<br/>clock -w<br/>把系统时间写入CMOS即可<br/>参看：http://linux.net527.cn/fuwuqiyingyong/Webfuwuqi/16516.html<br/>---------------------<br/>配置nginx和phpfastcgi平滑过度：<br/>创建php-fpm配置文件（php-fpm是为PHP打的一个FastCGI管理补丁，可以平滑变更php.ini配置而无需重启php-cgi）：<br/>　　在/usr/local/webserver/php/etc/目录中创建php-fpm.conf文件：<br/><br/>rm -f /usr/local/webserver/php/etc/php-fpm.conf<br/>vi /usr/local/webserver/php/etc/php-fpm.conf<br/>输入以下内容（如果您安装 Nginx + PHP 用于程序调试，请将以下的&lt;value name=&quot;display_errors&quot;&gt;0&lt;/value&gt;改为&lt;value name=&quot;display_errors&quot;&gt;1&lt;/value&gt;，以便显示PHP错误信息，否则，Nginx 会报状态为500的空白错误页）：<br/>优化fpm参数：<br/>[root@localhost]# vi php-fpm.conf 【把前面的分号给去掉】<br/><br/>user = www <br/>group = www <br/>pm = dynamic<br/>pm.max_children = 10 <br/>pm.start_servers = 5 <br/>pm.min_spare_servers = 2 <br/>pm.max_spare_servers = 7 <br/>pm.max_requests = 120<br/><br/>创建Nginx日志目录：<br/>mkdir -p /data1/logs<br/>chmod +w /data1/logs<br/>chown -R www:www /data1/logs<br/><br/>创建Nginx配置文件<br/>在/usr/local/webserver/nginx/conf/目录中创建nginx.conf文件：<br/>rm -f /usr/local/webserver/nginx/conf/nginx.conf<br/>vi /usr/local/webserver/nginx/conf/nginx.conf<br/><br/>&lt;!--Begin--&gt;<br/>user&nbsp;&nbsp;www www;<br/>worker_processes 8;<br/>error_log&nbsp;&nbsp;/data1/logs/nginx_error.log&nbsp;&nbsp;crit;<br/>pid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/webserver/nginx/nginx.pid;<br/>#Specifies the value for maximum file descriptors that can be opened by this process. <br/>worker_rlimit_nofile 51200;<br/>events <br/>&#123;<br/>&nbsp;&nbsp;use epoll;<br/>&nbsp;&nbsp;worker_connections 51200;<br/>&#125;<br/>http <br/>&#123;<br/>&nbsp;&nbsp;include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mime.types;<br/>&nbsp;&nbsp;default_type&nbsp;&nbsp;application/octet-stream;<br/>&nbsp;&nbsp;#charset&nbsp;&nbsp;gb2312;<br/>&nbsp;&nbsp;server_names_hash_bucket_size 128;<br/>&nbsp;&nbsp;client_header_buffer_size 32k;<br/>&nbsp;&nbsp;large_client_header_buffers 4 32k;<br/>&nbsp;&nbsp;client_max_body_size 8m;<br/>&nbsp;&nbsp;sendfile on;<br/>&nbsp;&nbsp;tcp_nopush&nbsp;&nbsp;&nbsp;&nbsp; on;<br/>&nbsp;&nbsp;keepalive_timeout 60;<br/>&nbsp;&nbsp;tcp_nodelay on;<br/>&nbsp;&nbsp;fastcgi_connect_timeout 300;<br/>&nbsp;&nbsp;fastcgi_send_timeout 300;<br/>&nbsp;&nbsp;fastcgi_read_timeout 300;<br/>&nbsp;&nbsp;fastcgi_buffer_size 64k;<br/>&nbsp;&nbsp;fastcgi_buffers 4 64k;<br/>&nbsp;&nbsp;fastcgi_busy_buffers_size 128k;<br/>&nbsp;&nbsp;fastcgi_temp_file_write_size 128k;<br/>&nbsp;&nbsp;gzip on;<br/>&nbsp;&nbsp;gzip_min_length&nbsp;&nbsp;1k;<br/>&nbsp;&nbsp;gzip_buffers&nbsp;&nbsp;&nbsp;&nbsp; 4 16k;<br/>&nbsp;&nbsp;gzip_http_version 1.0;<br/>&nbsp;&nbsp;gzip_comp_level 2;<br/>&nbsp;&nbsp;gzip_types&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text/plain application/x-javascript text/css application/xml;<br/>&nbsp;&nbsp;gzip_vary on;<br/>&nbsp;&nbsp;#limit_zone&nbsp;&nbsp;crawler&nbsp;&nbsp;$binary_remote_addr&nbsp;&nbsp;10m;<br/>&nbsp;&nbsp;server<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;listen&nbsp;&nbsp;80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;status.blog.jackxiang.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;location / &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;stub_status on;<br/>&nbsp;&nbsp;&nbsp;&nbsp;access_log&nbsp;&nbsp; off;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;server<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;jackxiang.com www.jackxiang.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;index index.html index.htm index.php;<br/>&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;/data0/htdocs/blog;<br/>&nbsp;&nbsp;if (!-e $request_filename)<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;rewrite ^/post/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /read.php?entryid=$1&amp;page=$2&amp;part=$3 last;<br/>&nbsp;&nbsp;rewrite ^/page/([0-9]+)/([0-9]+)/?$ /index.php?mode=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/starred/([0-9]+)/?([0-9]+)?/?$ /star.php?mode=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/category/([^/]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=category_$1&amp;mode=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^/archiver/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=archive&amp;cm=$1&amp;cy=$2&amp;mode=$3&amp;page=$4 last;<br/>&nbsp;&nbsp;rewrite ^/date/([0-9]+)/([0-9]+)/([0-9]+)/?([0-9]+)?/?([0-9]+)?/?$ /index.php?go=showday_$1-$2-$3&amp;mode=$4&amp;page=$5 last;<br/>&nbsp;&nbsp;rewrite ^/user/([0-9]+)/?$ /view.php?go=user_$1 last;<br/>&nbsp;&nbsp;rewrite ^/tags/([^/]+)/?([0-9]+)?/?([0-9]+)?/?$ /tag.php?tag=$1&amp;mode=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^/component/id/([0-9]+)/?$ /page.php?pageid=$1 last;<br/>&nbsp;&nbsp;rewrite ^/component/([^/]+)/?$ /page.php?pagealias=$1 last;<br/>&nbsp;&nbsp;#Force redirection for old rules<br/>&nbsp;&nbsp;rewrite ^/read&#92;.php/([0-9]+)&#92;.htm$ http://$host/post/$1/ permanent;<br/>&nbsp;&nbsp;rewrite ^/post/([0-9]+)&#92;.htm$ http://$host/post/$1/ permanent;<br/>&nbsp;&nbsp;rewrite ^/post/([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/post/$1/$2/ permanent;<br/>&nbsp;&nbsp;rewrite ^/post/([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/post/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;rewrite ^/index&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/page/$1/$2/ permanent;<br/>&nbsp;&nbsp;rewrite ^/star&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/starred/$1/$2/ permanent;<br/>&nbsp;&nbsp;rewrite ^/category&#92;_([0-9]+)&#92;.htm$ http://$host/category/$1/ permanent;<br/>&nbsp;&nbsp;rewrite ^/category&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/category/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;rewrite ^/archive&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/archiver/$1/$2/ permanent;<br/>&nbsp;&nbsp;rewrite ^/archive&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/archiver/$1/$2/$3/$4/ permanent;<br/>&nbsp;&nbsp;rewrite ^/showday&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/date/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;rewrite ^/showday&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;_([0-9]+)&#92;.htm$ http://$host/date/$1/$2/$3/$4/$5/ permanent;<br/>&nbsp;&nbsp;#Filename alias<br/>&nbsp;&nbsp;rewrite ^/([a-zA-Z0-9_-]+)/?([0-9]+)?/?([0-9]+)?/?$ /read.php?blogalias=$1&amp;page=$2&amp;part=$3 last;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;#limit_conn&nbsp;&nbsp; crawler&nbsp;&nbsp;20;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;location ~ .*&#92;.(php&#124;php5)?$<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#fastcgi_pass&nbsp;&nbsp;unix:/tmp/php-cgi.sock;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass&nbsp;&nbsp;127.0.0.1:9000;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_index index.php;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include fcgi.conf;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;location ~ .*&#92;.(gif&#124;jpg&#124;jpeg&#124;png&#124;bmp&#124;swf)$<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;30d;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;location ~ .*&#92;.(js&#124;css)?$<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1h;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;log_format&nbsp;&nbsp;access&nbsp;&nbsp;&#039;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#039;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;$status $body_bytes_sent &quot;$http_referer&quot; &#039;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;&quot;$http_user_agent&quot; $http_x_forwarded_for&#039;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;access_log&nbsp;&nbsp;/data1/logs/access.log&nbsp;&nbsp;access;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/>&lt;--End--&gt;<br/><br/>安装Memache：<br/>libevent-2.0.10-stable：<br/>wget http://monkey.org/~provos/libevent-2.0.10-stable.tar.gz<br/><br/>tar xzf libevent-2.0.10-stable.tar.gz<br/>cd libevent-2.0.10-stable<br/>./configure<br/>make<br/>make install<br/><br/>#刷新库文件连接<br/><br/>ldconfig<br/>Then Memcache setup：<br/>wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz<br/>tar xzf&nbsp;&nbsp;memcached-1.4.5.tar.gz<br/>cd memcached-1.4.5<br/> ./configure&nbsp;&nbsp;--prefix=/usr/local/webserver/memcached<br/>make<br/>make install<br/><br/><br/>#增加用户组memcached和用户memcached<br/>/usr/sbin/groupadd memcached<br/>/usr/sbin/useradd -g memcached memcached<br/>启动Memcached时可能出现的问题：<br/>找不到以下的so，用如下操作及可：<br/>ln -s /usr/local/lib/libevent-2.0.so.5&nbsp;&nbsp;/usr/lib/<br/><br/><br/>启动PHP的FastCGI：<br/>启动PHP FastCGI：<br/>cp /root/jackxiang.com/php-5.3.6/sapi/fpm/init.d.php-fpm /etc/init.d/phpfpm<br/>chmod 755 /etc/init.d/phpfpm<br/>ulimit -SHn 51200<br/>/etc/init.d/phpfpm start<br/>启动PHp的FastCGI时可能会出现下面错误：<br/>出现下面的错误(这个错误是我在安装过程中发现的，是内在不足导致的，在文章的结尾优化后，就不会有这样的问题了，在这里做个记录，方便大家学习) <br/>Starting php_fpm eAccelerator: Could not allocate 67108864 bytes, the maximum size the kernel allows is 33554432 bytes. Lower the amount of memory request or increase the limit in /proc/sys/kernel/shmmax. <br/>PHP Warning:&nbsp;&nbsp;[eAccelerator] Can not create shared memory area in Unknown on line 0 <br/>PHP Fatal error:&nbsp;&nbsp;Unable to start eAccelerator module in Unknown on line 0 <br/>failed<br/><br/>#说明<br/>php.ini中设置的eAccelerator，eaccelerator.shm_size=&quot;64&quot;，解释：eaccelerator可使用的共享内存大小(单位为MB)，即64M<br/>在Linux下，单个进程的最大内存使用量受/proc/sys/kernel/shmmax中设置的数字限制(单位为字节)&nbsp;&nbsp;/proc/sys/kernel/shmmax = 33554432 （32M）<br/>临时更改该值：<br/>echo 128000000 &gt; /proc/sys/kernel/shmmax<br/>或者<br/>vi /etc/sysctl.conf<br/>#add by jack<br/>kernel.shmmax = 128000000<br/>使配置立即生效：<br/>/sbin/sysctl -p<br/>&nbsp;&nbsp; <br/><br/>优化Linux内核参数<br/>vi /etc/sysctl.conf<br/>net.ipv4.tcp_fin_timeout = 30<br/>net.ipv4.tcp_keepalive_time = 300<br/>net.ipv4.tcp_syncookies = 1<br/>net.ipv4.tcp_tw_reuse = 1<br/>net.ipv4.tcp_tw_recycle = 1<br/>net.ipv4.ip_local_port_range = 5000&nbsp;&nbsp;&nbsp;&nbsp;65000使配置立即生效：<br/>/sbin/sysctl -p<br/><br/>配置开机自动启动Nginx + PHP：<br/>在不停止Nginx服务的情况下平滑变更Nginx配置<br/>修改/usr/local/webserver/nginx/conf/nginx.conf配置文件后，请执行以下命令检查配置文件是否正确<br/>/usr/local/webserver/nginx/sbin/nginx -t<br/>nginx: the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok<br/>nginx: configuration file /usr/local/webserver/nginx/conf/nginx.conf test is successful这时，输入以下命令查看Nginx主进程号：<br/>ps -ef &#124; grep &quot;nginx: master process&quot; &#124; grep -v &quot;grep&quot; &#124; awk -F &#039; &#039; &#039;&#123;print $2&#125;&#039;<br/>这时，执行以下命令即可使修改过的Nginx配置文件生效：<br/>kill -HUP 6302<br/>kill -HUP `cat /usr/local/webserver/nginx/nginx.pid`<br/><br/>编写每天定时切割Nginx日志的脚本:<br/>创建脚本/usr/local/webserver/nginx/sbin/cut_nginx_log.sh<br/>vi /usr/local/webserver/nginx/sbin/cut_nginx_log.sh<br/><br/>#!/bin/bash<br/># This script run at 00:00<br/># The Nginx logs path<br/>logs_path=&quot;/usr/local/webserver/nginx/logs/&quot;<br/>mkdir -p $&#123;logs_path&#125;$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/<br/>mv $&#123;logs_path&#125;access.log $&#123;logs_path&#125;$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/access_$(date -d &quot;yesterday&quot; +&quot;%Y%m%d&quot;).log<br/>kill -USR1 `cat /usr/local/webserver/nginx/nginx.pid`<br/>设置crontab，每天凌晨00:00切割nginx访问日志<br/>crontab -e<br/>00 00 * * * /bin/bash&nbsp;&nbsp;/usr/local/webserver/nginx/sbin/cut_nginx_log.sh<br/><br/><br/><br/>开机自动 启动namp服务如下设置,关于开机程序的自动启动：<br/>1）如专门启动Mysql这样一个，你可以参考：<br/>开机自动 启动Mysql的方法： http://www.jackxiang.com/post/4730/&nbsp;&nbsp;，<br/>也就是随便芿一个可执行文件到目录：/etc/rc.d/init.d/ ，赋予可执行权限写入开机启动的脚本即可。<br/>2）如果要同时启动多个服务器软件，则如下所示：<br/>开机启动知识及步骤如下：<br/>想用命令chkconfig加载自启动.提示&quot;**服务不支持chkconfig&quot;,原来是自己写的脚本时,忘记写两行了.开头一般要这样写,345是启动级，85和15分别是启动优先级，关闭优先级，下面的就是描述了。:<br/>#!/bin/bash<br/>#chkconfig:345 61 61&nbsp;&nbsp;//此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)<br/>#description:nginx php mysql memcache start shell<br/>,修改来自Apache里的启动shell，也可以不用修改：<br/>保存为/etc/init.d/lnmp，内容如下：<br/>#!/bin/bash<br/>#chkconfig:345 61 61<br/>#description:nginx php mysql memcache start shell<br/>echo &quot;Starting memcache mysql php nginx daemon...&quot;<br/>ulimit -SHn 51200<br/>nohup /usr/local/webserver/memcached/bin/memcached -d -m 1 -u www -p 11211 &gt; /dev/null 2&gt;&amp;1 &amp;<br/>nohup /usr/local/webserver/mysql/bin/mysqld_safe --user=mysql&nbsp;&nbsp;&gt; /dev/null 2&gt;&amp;1 &amp;<br/>nohup /etc/init.d/phpfpm start &gt; /dev/null 2&gt;&amp;1 &amp;<br/>nohup /usr/local/webserver/nginx/sbin/nginx&nbsp;&nbsp;-c /usr/local/webserver/nginx/conf/nginx.conf &gt; /dev/null 2&gt;&amp;1 &amp;<br/><br/><br/>把脚本拷贝至/etc/init.d/目录下,执行命令:<br/>ln -s /etc/init.d/lnmp /etc/rc.d/rc3.d/S61lnmp<br/>ln -s /etc/init.d/lnmp /etc/rc.d/rc4.d/S61lnmp<br/>ln -s /etc/init.d/lnmp /etc/rc.d/rc5.d/S61lnmp<br/>再执行<br/>chkconfig --add lnmp<br/>chkconfig --levels lnmp345 on //也成<br/>开机启动：<br/>service lnmp start<br/>env: /etc/init.d/lnmp: 权限不够<br/>chmod -R a+x /etc/init.d/lnmp<br/>reboot 重启动，看服务起来了没，没起来再运行：service lnmp 试试，这儿就不用start了，因上面没有start这个参数！！！<br/>要删除某个service的自动启动的设置，使用--del选项，如下：<br/># chkconfig --del lnmp<br/># chkconfig --list &#124; grep lnmp<br/><br/>Nginx这块自己有ssl启动需要输入密码，默认的那个不行，怎么干掉？<br/>nginx 开机启动的service项想删除，service nginx start 这个想干掉，我现在放开机启动里了：<br/>/etc/init.d/nginx&nbsp;&nbsp; //可以把它重写成自己的，因为我的有https<br/>chkconfig nginx off<br/><br/><br/>=======================shell环境关于bash启动脚本======================================<br/>/etc/profile<br/>/etc/bashrc<br/>~/.bash_profile<br/>~/.bashrc<br/>~/.bash_logout<br/>每一个文件都有特殊的功用并对登陆和交互环境有不同的影响。<br/>/etc/profile 和 ~/.bash_profile 是在启动一个交互登陆shell的时候被调用。<br/>/etc/bashrc 和 ~/.bashrc 是在一个交互的非登陆shell启动的时候被调用。<br/>~/.bash_logout 在用户注销登陆的时候被读取<br/><br/>一 个交互的登陆shell会在 /bin/login 成功登陆之后运行。一个交互的非登陆shell是通过命令行来运行的，如[prompt]$/bin/bash。一般一个非交互的shell出现在运行 shell脚本的时候。之所以叫非交互的shell，是因为它不在命令行上等待输入而只是执行脚本程序。<br/>关于开机程序的自动启动<br/>系统脚本可以放置在/etc/rc.d/init.d中并建立/etc/rc.d/rc?.d链接，也可以直接放置在/etc/rc.d/rc.local中。<br/>init.d脚本包含完整的start,stop,status,reload等参数，是标准做法，推荐使用。<br/>为特定用户使用的程序（如有的用户需要使用中文输入法而有的不需要）放置在~/中的bash启动脚本中。<br/><br/>chkconfig --list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//开机启动的list<br/>ntsysv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //simple gui,直接修改<br/>chkconfig httpd&nbsp;&nbsp;off //还是这个见效快****<br/>chkconfig iptables&nbsp;&nbsp;off&nbsp;&nbsp;//关闭防火墙，还是这个见效快*<br/>chkconfig --list &#124;grep sendmail<br/>chkconfig sendmail&nbsp;&nbsp;off<br/>chkconfig --list &#124;grep auditd<br/>chkconfig auditd&nbsp;&nbsp;off<br/><br/><br/>chkconfig rpcgssd&nbsp;&nbsp;off<br/>chkconfig rpcidmapd&nbsp;&nbsp;off<br/>chkconfig rpcsvcgssd&nbsp;&nbsp;off<br/>chkconfig portmap off最近发现了一个Deamo进程也可以关闭：<br/>udp&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0.0.0.0:46563&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2295/avahi-daemon:&nbsp;&nbsp;<br/>udp&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0.0.0.0:5353&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2295/avahi-daemon:<br/>udp&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 :::5353&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :::*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2295/avahi-daemon:<br/>步骤方法如下：<br/>chkconfig --list avahi-daemon<br/>root@116.255.139.240:/data0/htdocs/blog/template# chkconfig --list avahi-daemon<br/>avahi-daemon&nbsp;&nbsp;&nbsp;&nbsp;0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:off&nbsp;&nbsp; 3:on&nbsp;&nbsp;&nbsp;&nbsp;4:on&nbsp;&nbsp;&nbsp;&nbsp;5:on&nbsp;&nbsp;&nbsp;&nbsp;6:off<br/>avahi-daemon 关闭:<br/>service avahi-daemon stop <br/>chkconfig avahi-daemon&nbsp;&nbsp;off 再看：<br/>root@116.255.139.240:/data0/htdocs/blog/template# chkconfig --list avahi-daemon<br/>avahi-daemon&nbsp;&nbsp;&nbsp;&nbsp;0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:off&nbsp;&nbsp; 3:off&nbsp;&nbsp; 4:off&nbsp;&nbsp; 5:off&nbsp;&nbsp; 6:off确实关闭了。<br/><br/>试试把 avahi－daemon 服务关闭，你会得到空前变化。avahi－daemon<br/>&nbsp;&nbsp;&nbsp;&nbsp; Avahi 是 zeroconf 协议的实现。它可以在没有 DNS 服务的局域网里发现基于 zeroconf 协议的设备和服务。它跟mDNS 一样。除非你有兼容的设备或使用 zeroconf 协议的服务，否则应该关闭它。现在用的基本都是DNS了。<br/>&nbsp;&nbsp; 更专业点讲就是The Avahi mDNS/DNS-SD daemon implements Apple’s Zeroconfarchitecture(also known as &quot;Rendezvous&quot; or &quot;Bonjour&quot;). The daemonregisters local IP addresses and static services using mDNS/DNS-SD andprovides two IPC APIs for local programs to make use of the mDNS recordcache the avahi-daemon maintains.<br/>&nbsp;&nbsp; avahi－daemon is a daemon which runs on client machines to performZeroconf service discovery on a network. avahi-daemon must be runningon systems that use Avahi for service discovery. Avahi-daemon shouldnot be running otherwise.<br/><br/>AutoMount 自动挂载功能<br/>方法：&nbsp;&nbsp;&nbsp;&nbsp;启动进程autofs<br/>&nbsp;&nbsp;&nbsp;&nbsp; 在RedHat安装后期，在选择启动时需要自动执行进程的那一步骤剔选“autofs”。<br/>&nbsp;&nbsp;&nbsp;&nbsp;如果已经安装好了作业系统，也可以更改该项设置。在Terminal中输入“setup”指令，选“System services”，或者直接输入启动进程配置指令“ntsysv”都可以打开启动进程配置介面，剔选“autofs后，下次进入RedHat Linux后，这一进程就会被自动装载。<br/><br/>1837 root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15&nbsp;&nbsp; 0 29424 1376 1060 S&nbsp;&nbsp;0.0&nbsp;&nbsp;0.5&nbsp;&nbsp; 0:00.23 automount<br/>root@116.255.139.240:~# chkconfig --list&#124;grep autofs<br/>autofs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:off&nbsp;&nbsp; 3:on&nbsp;&nbsp;&nbsp;&nbsp;4:on&nbsp;&nbsp;&nbsp;&nbsp;5:on&nbsp;&nbsp;&nbsp;&nbsp;6:off<br/>chkconfig autofs&nbsp;&nbsp;off&nbsp;&nbsp; <br/>root@116.255.139.240:~# service autofs stop<br/><br/>vps取消设置自动挂载ISCSI分区的服务：<br/>方法一：<br/>用编辑器打开/etc/fstab 例如：gedit /etc/fstab ,并在最后一行加入下列命令<br/>/dev/sda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/mnt/t0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ext2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaults&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //如果是FAT分区，则将ext2改为vfat。（这个选项很重要，如果没有则无法成功自动挂载）<br/>关闭测试启动自动挂载磁盘的服务：<br/>root@116.255.139.240:~# chkconfig --list&#124;grep iscsi<br/>iscsi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:off&nbsp;&nbsp; 3:on&nbsp;&nbsp;&nbsp;&nbsp;4:on&nbsp;&nbsp;&nbsp;&nbsp;5:on&nbsp;&nbsp;&nbsp;&nbsp;6:off<br/>iscsid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:off&nbsp;&nbsp; 3:on&nbsp;&nbsp;&nbsp;&nbsp;4:on&nbsp;&nbsp;&nbsp;&nbsp;5:on&nbsp;&nbsp;&nbsp;&nbsp;6:off<br/>root@116.255.139.240:~# chkconfig iscsid off<br/>root@116.255.139.240:~# service iscsid stop<br/>Stopping iSCSI daemon: <br/>root@116.255.139.240:~#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;OK&nbsp;&nbsp;]<br/>Stopping automount:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;OK&nbsp;&nbsp;]<br/>php扩展ssh2的安装:<br/><br/> wget http://www.libssh2.org/download/libssh2-1.2.7.tar.gz<br/> cd libssh2-1.2.7<br/> ./configure<br/> make;make install<br/> pecl install -f ssh2<br/>选择：Y<br/>/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/ssh2.so<br/>You should add &quot;extension=ssh2.so&quot; to php.ini<br/>PHP SOAP Extension:<br/><br/>cd /root/jackxiang.com/php-5.3.6/ext/soap<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make;make install<br/>/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/soap.so<br/><br/>特别注意：<br/>开机启动SVN服务的Apache的设置方法：<br/>vim /etc/init.d/apache<br/>/usr/local/webserver/apache2/bin/apachectl start<br/>chmod 775 /etc/init.d/apache<br/>chkconfig apache on<br/>当然你也可以抄一个shell标准脚本,如前面php的phpfpm启动脚本。<br/>遇到443端口加密需要需要输入密码的还请慎重考虑，如下所示：<br/>Server svn.jackxiang.com:443 (RSA)<br/>Enter pass phrase:<br/>Apache:mod_ssl:Error: Pass phrase empty (needs to be at least 1 character).<br/>Enter pass phrase:<br/><br/>Ok: Pass Phrase Dialog successful.<br/>需要研究如何自动启动并自动地输入密码。<br/>这块还不行，这块expect里的spawn要和ssh结合，nginx这种情况还不行,下面这个有警告，但是能执行：<br/><textarea name="code" class="php" rows="15" cols="100">
 #!/bin/bash&nbsp;&nbsp; 
pkill -9 nginx&nbsp;&nbsp;
expect&lt;&lt;- END&nbsp;&nbsp;
spawn /usr/local/scripts/startNginx.sh&nbsp;&nbsp;
expect &quot;*Enter PEM pass phrase:&quot;&nbsp;&nbsp;
send &quot;jackxiang*&#92;r&quot;&nbsp;&nbsp;
send &quot;jackxiang*&#92;r&quot;&nbsp;&nbsp;
expect eof&nbsp;&nbsp; 
exit&nbsp;&nbsp; 
END&nbsp;&nbsp;
</textarea><br/>上面路径要写死/usr/local/scripts，别相对：<br/>startNginx.sh<br/><textarea name="code" class="php" rows="15" cols="100">
cat startNginx.sh&nbsp;&nbsp; 
/usr/local/nginx/sbin/nginx&nbsp;&nbsp;
</textarea><br/>升级到PHP5.3.8后启动FastCGI出现：<br/>root@116.255.139.240:~/software/eaccelerator-0.9.6.1# cat /root/runphp.sh&nbsp;&nbsp;<br/>pkill -9 php<br/>usleep 100000<br/>/etc/init.d/phpfpm start<br/><br/>=============执行上面这段代码:<br/>root@116.255.139.240:~/software/eaccelerator-0.9.6.1# sh /root/runphp.sh <br/>shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory<br/>shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory<br/>Starting php-fpm <br/>done<br/>原因是：估计升级PHP后 还是在原来PHP目录下，到了一个不存在的目录中 而显示错误.<br/><br/><br/><br/>Mysql的数据文件移动时出现的新问题：2011-10-16 Add By:jack。<br/>主要是讲述新版本的Mysql在移动目录时，在特别是有Innodb的情况下，出现问题解决问题的一个过程，及Mysql的sock文件和PHP接合的问题。<br/>Mysql数据文件搬家到另外一个目录出现的 二个问题（从/usr/local/webserver/mysql/data/ 搬家到：/data0/data），如下：<br/>1.Innodb出现问题，Mysql启动不了，如附录中的日志所示：<br/>InnoDB: The InnoDB memory heap is disabled<br/>这样的警告，查资料说，只要在my.cnf中加入以下，就可以消除以上警告<br/>innodb_use_sys_malloc =0<br/>系统默认为<br/>innodb_use_sys_malloc =1<br/>似乎有人说innodb_use_sys_malloc =1速度更快，我还没有得到证实。<br/>所以，我就没有修改了。 <br/><br/>解决办法：<br/>cd /data0/data<br/>rm -Rf ibdata1<br/>rm -Rf ib_logfile0<br/>rm -Rf ib_logfile1<br/><br/>========================================================<br/>1.检查Linux下Mysql的日志<br/>2.错误信息是&quot;Default storage engine (InnoDB) is not available&quot;<br/><br/>解决方法：<br/>1.删除在MySQL安装目录下的Data目录中的<br/>ib_logfile0<br/>ib_logfile1<br/>2.找到在配置MySQL服务器时指定的InfoDB目录删除掉<br/>ibdata1<br/>3.重新启动MySQL的Service<br/>这个问题第二天又摸索了一下，其实是可以用InnoDB引擎的.<br/>需要在mysql生成的配置文件增加一行配置,即增加一个临时目录，这个在启动mysql服务的时候是需要的.<br/>[mysqld]<br/>tmpdir=/tmp<br/>我的my.ini配置文件如下，注意红色字体，是默认不会生成的;<br/>========================================================<br/><br/><br/>如下：<br/>root@116.255.139.240:/data0/data# rm -Rf ib_logfile0 ib_logfile1<br/>root@116.255.139.240:/data0/data# rm -Rf ibdata1<br/>root@116.255.139.240:/data0/data# rm -Rf ibdata1<br/><br/>后续指定DB目录，和InnoDB目录及日志文件设置如下：<br/>datadir&nbsp;&nbsp;= /data0/data/<br/>innodb_data_home_dir = /data0/data/<br/> innodb_data_home_dir = /data0/data/<br/> innodb_log_group_home_dir = /data0/data/<br/> innodb_data_file_path = ibdata1:128M:autoextend<br/> <br/> # You can set .._buffer_pool_size up to 50 - 80 %<br/> # of RAM but beware of setting memory usage too high<br/> <br/> innodb_use_sys_malloc = 0<br/> innodb_buffer_pool_size = 16M<br/> innodb_additional_mem_pool_size = 4M<br/> # Set .._log_file_size to 25 % of buffer pool size<br/> innodb_log_file_size = 5M<br/> innodb_log_buffer_size = 5M<br/> innodb_flush_log_at_trx_commit = 1<br/> innodb_lock_wait_timeout = 50<br/> <br/> #log write and so on...<br/> general-log = /data0/data/error_log/log-error.log<br/> log-error = /data0/data/error_log/log-error.log<br/> slow-query-log = /data0/data/error_log/log-slow-query.log<br/> <br/> #slow query search<br/> slow_query_log=1<br/> slow_query_log_file = /data0/data/slow_query_log/mysql-slow.log<br/> long_query_time = 2<br/> log-queries-not-using-indexes<br/> <br/><br/><br/>2.移动数据文件目录后再访问时出现了问题二：<br/>&nbsp;&nbsp;Bo-Blog Database System Tips: Can not connect to MySQL server<br/>Time: 2011-10-16 8:09am<br/>Script:<br/>Error: Can&#039;t connect to local MySQL server through socket &#039;/usr/local/webserver/mysql/data/mysql.sock&#039; (2)<br/>Errno.: 2002<br/><br/>检测php.ini的设置,再检测my.conf里面的值设成一样就OK 另外目录mysql.sock所在目录的读取权限也是<br/>如果用php连接要特别注意php.ini的设置<br/>mysql.default_socket=(默认为空) ,这块连接Mysql相关的设置请看：http://www.jackxiang.com/post/4327/<br/>所以首要侨务检测php.ini的设置,再检测my.conf里面的值设成一样就OK<br/>另外目录mysql.sock所在目录的读取权限也是问题(兄弟们原谅我linux下的目录权限真的是不懂,所以简单点就直接chmod 777了)<br/>另外要特别注意,我想这点才是可能导致失败的就是web目录不能用root用户运行.而应该用nobody用户<br/><br/># vi /etc/my.cnf<br/>[mysqld]<br/>port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 3306<br/>socket&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= /data0/data/mysql.sock<br/>vi /usr/local/webserver/php/etc/php.ini<br/>mysql.default_socket =<br/>修改成和修改后的一样即可：<br/>mysql.default_socket = /data0/data/mysql.sock<br/>是FastCGI得重启fastcgi的Php，而如是Apache，则重启动Apache即可，就是把PHP.ini给纳入重新初始化。<br/>附录Mysql启动后的日志情况：<br/>111016 16:01:29 mysqld_safe Starting mysqld daemon with databases from /data0/data<br/>InnoDB: Mutexes and rw_locks use InnoDB&#039;s own implementation<br/>InnoDB: Compressed tables use zlib 1.2.3<br/>111016 16:01:29&nbsp;&nbsp;InnoDB: Initializing buffer pool, size = 18.0M<br/>111016 16:01:29&nbsp;&nbsp;InnoDB: Completed initialization of buffer pool<br/>InnoDB: The first specified data file /data0/data/ibdata1 did not exist:<br/>InnoDB: a new database to be created!<br/>111016 16:01:29&nbsp;&nbsp;InnoDB: Setting file /data0/data/ibdata1 size to 128 MB<br/>InnoDB: Database physically writes the file full: wait...<br/>InnoDB: Progress in MB: 100<br/>InnoDB: Error: all log files must be created at the same time.<br/>InnoDB: All log files must be created also in database creation.<br/>InnoDB: If you want bigger or smaller log files, shut down the<br/>InnoDB: database and make sure there were no errors in shutdown.<br/>InnoDB: Then delete the existing log files. Edit the .cnf file<br/>InnoDB: and start the database again.<br/>111016 16:01:49 [ERROR] Plugin &#039;InnoDB&#039; init function returned error.<br/>111016 16:01:49 [ERROR] Plugin &#039;InnoDB&#039; registration as a STORAGE ENGINE failed.<br/>111016 16:01:49 [ERROR] Unknown/unsupported storage engine: InnoDB<br/>111016 16:01:49 [ERROR] Aborting<br/>启动Ok如下：<br/>111016 16:05:13 mysqld_safe Starting mysqld daemon with databases from /data0/data<br/>InnoDB: Mutexes and rw_locks use InnoDB&#039;s own implementation<br/>InnoDB: Compressed tables use zlib 1.2.3<br/>111016 16:05:13&nbsp;&nbsp;InnoDB: Initializing buffer pool, size = 16.0M<br/>111016 16:05:13&nbsp;&nbsp;InnoDB: Completed initialization of buffer pool<br/>InnoDB: The first specified data file /data0/data/ibdata1 did not exist:<br/>InnoDB: a new database to be created!<br/>111016 16:05:13&nbsp;&nbsp;InnoDB: Setting file /data0/data/ibdata1 size to 128 MB<br/>InnoDB: Database physically writes the file full: wait...<br/>InnoDB: Progress in MB: 100<br/>111016 16:05:22&nbsp;&nbsp;InnoDB: Log file /data0/data/ib_logfile0 did not exist: new to be created<br/>InnoDB: Setting log file /data0/data/ib_logfile0 size to 5 MB<br/>InnoDB: Database physically writes the file full: wait...<br/>111016 16:05:23&nbsp;&nbsp;InnoDB: Log file /data0/data/ib_logfile1 did not exist: new to be created<br/>InnoDB: Setting log file /data0/data/ib_logfile1 size to 5 MB<br/>InnoDB: Database physically writes the file full: wait...<br/>InnoDB: Doublewrite buffer not found: creating new<br/>InnoDB: Doublewrite buffer created<br/>InnoDB: 127 rollback segment(s) active.<br/>InnoDB: Creating foreign key constraint system tables<br/>InnoDB: Foreign key constraint system tables created<br/>111016 16:05:24&nbsp;&nbsp;InnoDB: 1.1.4 started; log sequence number 0<br/>111016 16:05:24 [Note] Event Scheduler: Loaded 0 events<br/>111016 16:05:24 [Note] /usr/local/webserver/mysql/bin/mysqld: ready for connections.<br/>Version: &#039;5.5.8-log&#039;&nbsp;&nbsp;socket: &#039;/data0/data/mysql.sock&#039;&nbsp;&nbsp;port: 3306&nbsp;&nbsp;Source distribution<br/><br/><br/><br/>注意，Nginx下的file_get_contents会出现100%的Cpu情况，原因是：<br/>开启&lt;value name=&quot;request_slowlog_timeout&quot;&gt;3s&lt;/value&gt;记录慢执行日志，会在日志中打印出执行慢的代码行数。php-cgi(php-fpm) 使用了Libevent，而Libevent 在 Linux 2.6 内核以上默认会使用 epoll I/O 模型处理 FastCGI 网络请求，而非 select/poll。在慢日志记录的代码行数中，包含 file_get_contents 以及其他函数，而 file_get_contents 等作为 Client 发起 HTTP 请求的函数使用的是 select/poll 模型，也就是说，只有 file_get_contents 等满足“TCP请求默认不超时、使用select/poll 模型、进程CPU 100%”的网络操作函数，会导致 strace -p 看到的这种情况。<br/><br/>最好还是用Curl吧，这个靠谱些。<br/><br/><br/>后补上，如何在PHP里安装GD2，方法如下：<br/>如果源码安装需要找齐下面的源码包，在安GD2时需要指定其安装的位置：<br/>./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype<br/><br/>如果安装gd版本低，会报configure: error: Unable to find libgd.(a&#124;so) &gt;= 2.1.0 anywhere under /usr/local/gd<br/>GD库重装成功 尝试重装PHP 依然报错 查找到libgd.*位置 复制到/usr/local/gd/ 依然找不到。 找到原因，GD库版本过低，低于2.1.0 下载最新版本<br/>替换高版本gd解决,也可能是这样解决：<br/>configure: error: Unable to find libgd.(a&#124;so) &gt;= 2.1.0 anywhere under /usr/local/libgd<br/>如果提示libgd版本错误，把php编译参数--with-gd=/usr/local/libgd修改为--with-gd即可 ，Dockerfile 是这样的：--with-gd=/usr &#92; ，指向/usr。<br/><br/><br/><textarea name="code" class="php" rows="15" cols="100">
安装GD
yum install libXpm-devel.x86_64
cd /usr/local/src
wget https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz
tar -zxvf libgd-2.1.0.tar.gz
cd libgd-2.1.0
./configure --prefix=/usr/local/gd --with-png=/usr/local/png --with-jpeg=/usr/local/jpeg --with- freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig
make
make install
ln -s /usr/local/gd/lib/* /usr/lib/
</textarea><br/>修改成下面这个路径试试：<br/>--with-gd=/usr/local/gd &#92;<br/><br/><br/>而要是自带的这个rpm，用linux的yum安好即可，特别要注意要用到的devel这样的包，这个是有一个头文件在里面的，<br/>rpm -ql zlib-devel-1.2.3-27.el6.i686<br/>/usr/include/zconf.h<br/>/usr/include/zlib.h<br/>/usr/lib/libz.so<br/><br/>如下,查看是否所有的包都安好了：<br/>root@192.168.225.128:~# rpm -qa&#124;grep zlib<br/>zlib-devel-1.2.3-27.el6.i686<br/>zlib-1.2.3-27.el6.i686<br/>root@192.168.225.128:~# rpm -qa&#124;grep libpng<br/>libpng-devel-1.2.46-1.el6_1.i686<br/>libpng-1.2.46-1.el6_1.i686<br/>root@192.168.225.128:~# rpm -qa&#124;grep freetype<br/>freetype-2.3.11-6.el6_1.8.i686<br/>freetype-devel-2.3.11-6.el6_1.8.i686<br/>root@192.168.225.128:~# rpm -qa&#124;grep libxml<br/>libxml2-2.7.6-4.el6_2.1.i686<br/>libxml2-devel-2.7.6-4.el6_2.1.i686<br/>root@192.168.225.128:~# rpm -qa&#124;grep gd<br/>gdbm-1.8.0-36.el6.i686<br/>root@192.168.225.128:~# rpm -qa&#124;grep jpeg<br/>libjpeg-6b-46.el6.i686<br/>libjpeg-devel-6b-46.el6.i686<br/>于是直接这样来安这个GD2即可：<br/>./configure --prefix=/usr/local/gd<br/><br/>** Configuration summary for gd 2.0.34:<br/><br/>&nbsp;&nbsp; Support for PNG library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes<br/>&nbsp;&nbsp; Support for JPEG library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br/>&nbsp;&nbsp; Support for Freetype 2.x library: yes<br/>&nbsp;&nbsp; Support for Fontconfig library:&nbsp;&nbsp; no<br/>&nbsp;&nbsp; Support for Xpm library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no<br/>&nbsp;&nbsp; Support for pthreads:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br/><br/><br/>make;make install<br/><br/><br/>PHP:<br/>--with-gd=/usr/local/gd<br/><br/>安装配置方法：<br/> /configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd=/usr/local/gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo enable-dom&nbsp;&nbsp;--enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session --enable-spl&nbsp;&nbsp;--enable-hash --enable-reflection <br/><br/><br/>重新指定so的位置:<br/>打开/etc/ld.so.conf<br/>include ld.so.conf.d/*.conf<br/>/usr/local/gd/lib<br/>ldconfig<br/><br/><br/><br/>再make;make install ，以上安装出现PHP还是跑到php5.3.10/ext/gd 并报错了。考。。。。<br/><br/>再试着用源码来安装(记录一下，安装是可以，但在最后时发现php还是去读取了PHP自己的目录下的ext/gd)，后面只有先暂时不安，在最后再来安装这个gd2：<br/>FreeType安装<br/>FreeType库是一个完全免费(开源)的、高质量的且可移植的字体引擎，它提供统一的接口来访问多种字体格式文件，包括TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF等。支持单色位图、反走样位图的渲染。FreeType库是高度模块化的程序库，虽然它是使用ANSI C开发，但是采用面向对象的思想，因此，FreeType的用户可以灵活地对它进行裁剪。<br/>[root@yznvm1 yzn]# wget http://nchc.dl.sourceforge.net/project/freetype/freetype2/2.4.8/freetype-2.4.8.tar.gz<br/>[root@yznvm1 yzn]# tar xzvf freetype-2.4.8.tar.gz&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>[root@yznvm1 yzn]# cd freetype-2.4.8&nbsp;&nbsp;&nbsp;&nbsp; <br/>[root@yznvm1 yzn]# ./configure --prefix=/usr/local/freetype&nbsp;&nbsp; <br/>[root@yznvm1 freetype-2.4.8]# make &amp;&amp; make install<br/>[root@yznvm1 yzn]# wget http://www.ijg.org/files/jpegsrc.v8c.tar.gz<br/>[root@yznvm1 yzn]# tar zxvf jpegsrc.v8c.tar.gz<br/>[root@yznvm1 yzn]# cd jpeg-8c/<br/>[root@yznvm1 jpeg-8c]# ./configure --prefix=/usr/local/jpeg<br/>[root@yznvm1 jpeg-8c]# make &amp;&amp;&nbsp;&nbsp;make install &amp;&amp; cd ..<br/>libpng<br/>可查看http://www.libpng.org/pub/png/libpng.html<br/>查看zlib版本<br/>[root@yznvm1 yzn]# rpm -qa&nbsp;&nbsp;zlib<br/>zlib-1.2.3-3<br/>zlib-1.2.3-3<br/>出于性能和安全考虑，zlib最好是1.2.5以上版本<br/>[root@yznvm1 yzn]# wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.7.tar.gz<br/>[root@yznvm1 yzn]# tar zxvf libpng-1.5.7.tar.gz<br/>[root@yznvm1 yzn]# cd libpng-1.5.7 <br/>[root@yznvm1 libpng-1.5.7]# ./configure --prefix=/usr/local/libpng<br/>[root@yznvm1 libpng-1.5.7]# make &amp;&amp; make install&nbsp;&nbsp;<br/>[root@yznvm1 libpng-1.5.7]# cd ..<br/>libgd <br/>http://www.libgd.org/&nbsp;&nbsp;这个网站down<br/>[root@yznvm1 gd-2.0.33]# http://www.boutell.com/gd/http/gd-2.0.33.tar.gz<br/>[root@yznvm1 gd-2.0.33]# tar xzvf gd-2.0.33.tar.gz <br/>[root@yznvm1 gd-2.0.33]# cd gd-2.0.33 <br/>[root@yznvm1 gd-2.0.33]# ln -s /usr/local/libpng/include/pngconf.h /usr/include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>[root@yznvm1 gd-2.0.33]# ln -s /usr/local/libpng/include/png.h /usr/include&nbsp;&nbsp;<br/>[root@yznvm1 gd-2.0.33]# ./configure --prefix=/usr/local/gd2 --with-freetype=/usr/local/freetype --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg<br/>[root@yznvm1 gd-2.0.33]# make <br/>[root@yznvm1 gd-2.0.33]# make install<br/><br/><br/>下面是全的安装配置configure文件，但实践中要注意下面四点：<br/>1）This is the test message -- configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.<br/>&nbsp;&nbsp;&nbsp;&nbsp;configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.<br/>&nbsp;&nbsp;&nbsp;&nbsp;Fix: yum install net-snmp-devel<br/>2）<br/>configure: WARNING: You will need re2c 0.13.4 or later 解决办法<br/>我在为php安装imagick-2.3.0模块的时候出现来错误<br/>configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.<br/>说需要安装re2c<br/>执行以下命令<br/>wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download<br/>tar -zxvf re2c-0.13.5.tar.gz<br/>cd re2c-0.13.5<br/>./configure &amp;&amp; make &amp;&amp; make install<br/>3）configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).<br/>yum install bison<br/>4）checking for lemon... no<br/>configure: warning: lemon versions supported for regeneration of libsqlite parsers: 1.0 (found: none).<br/>解决方法：<br/>wget http://www.sqlite.org/cvstrac/getfile/sqlite/tool/lemon.c [下载不了]<br/>这儿下：<br/>http://code.google.com/p/lemonbind/source/browse/tools/lemon.c<br/>gcc -o lemon lemon.c<br/>mv lemon /usr/local/bin<br/>重新运行 ./configure 后，问题解决。<br/><br/>最后正确的安装php5.3.10的配置configure方法，汇总，配置完所有的扩展要要用的配置参数了：<br/><textarea name="code" class="shell" rows="15" cols="100">
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gettext --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --with-snmp --enable-shmop --enable-sysvsem --enable-sysvshm --enable-calendar --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex&nbsp;&nbsp;--enable-fpm&nbsp;&nbsp;--enable-mbstring --enable-exif --enable-sysvmsg --with-mcrypt --with-gd&nbsp;&nbsp;--enable-gd-native-ttf --enable-gd-jis-conv --disable-debug --with-openssl --with-mhash --enable-pcntl --silent --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo --enable-dom&nbsp;&nbsp;--enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session&nbsp;&nbsp; --enable-hash&nbsp;&nbsp;--with-pdo-mysql=/usr/local/webserver/mysql
</textarea><br/>接着用如下make，不加参数会报错找不到ld什么的：<br/>make ZEND_EXTRA_LIBS=&#039;-liconv&#039; <br/>更多的事件驱动扩展，PHP5.3 下安装ZendGuardLoader及eaccelerator 加速器：<br/>http://www.jackxiang.com/post/5626/<br/><br/>PHP高一点的版本如：php-5.3.26，那些没有用的参数就不用了，于是得出下面的编译列表：<br/><textarea name="code" class="shell" rows="15" cols="100">
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gettext --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --with-snmp --enable-shmop --enable-sysvsem --enable-sysvshm --enable-calendar --enable-inline-optimization --with-curl --with-curlwrappers --enable-exif --enable-sysvmsg --with-mcrypt --with-gd --enable-gd-jis-conv --disable-debug --with-openssl --with-mhash --enable-pcntl --silent --enable-sockets --with-ldap&nbsp;&nbsp;&amp;&amp; make ZEND_EXTRA_LIBS=&#039;-liconv&#039;&nbsp;&nbsp;&amp;&amp; make install
</textarea><br/>如果想兼容Nginx和Apache2时，还应加上--with-apxs2，但只能编译成一种，不能同时编译既支持fastCGI，又支持Apache的传统方式：<br/>关于php编译时SAPI错误 ：<br/>近日在Centos6.3上编译php的时候出现了错误：You&#039;ve configured multiple SAPIs to be build. You can build only&nbsp;&nbsp; &#124;<br/>&#124; one SAPI module and CLI binary at the same time.<br/>翻译：<br/>You&#039;ve configured multiple SAPIs to be build.You can build only one SAPI module and CLI binary at the same time.(你已经配置了多个SAPIs,你只可以建立一个SAPI模块和一个CLI binary。）<br/><br/>导致的原因是我的配置参数中同时使用了--enable-fpm 与--with-apxs2= ，因此编译的时候出错了，去掉其中的任意一个参数编译成功。<br/><br/>checking for Apache 1.x module support via DSO through APXS... configure: error: You have enabled Apache 1.3 support while your server is Apache 2.&nbsp;&nbsp;Please use the appropiate switch --with-apxs2<br/>把下面的语句 --enable-fpm 去掉：就可以编译成功Apache下的PHP了。<br/><br/>./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath&nbsp;&nbsp;--enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex&nbsp;&nbsp;--enable-fpm&nbsp;&nbsp;--enable-mbstring --with-mcrypt --with-gd&nbsp;&nbsp;--enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo --enable-dom&nbsp;&nbsp;--enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session&nbsp;&nbsp; --enable-hash&nbsp;&nbsp;--with-pdo-mysql=/usr/local/webserver/mysql --with-apxs2=/usr/local/webserver/apache2/bin/apxs<br/><br/>make ZEND_EXTRA_LIBS=&#039;-liconv&#039;&nbsp;&nbsp;<br/><br/>会提示：如果要用Apache的线程安全模式，需要加上配置参数为： --enable-maintainer-zts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>参考：http://jackxiang.com/post/5868/<br/> You have built PHP for Apache&#039;s current non-threaded MPM.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/> If you change Apache to use a threaded MPM you must reconfigure <br/> PHP with --enable-maintainer-zts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>出现配置时的输出错误：<br/>configure :error:unable to find your mysql installation<br/>在--with-pdo-mysql后加上路径&nbsp;&nbsp;---with-pdo-mysql=/usr/local/webserver/mysql<br/>终于再次编译成功！！<br/><br/>Apache相关的编译成功参数情况如下：<br/><textarea name="code" class="php" rows="15" cols="100">
 ./configure --prefix=/usr/local/webserver/php-5.3.20 --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath&nbsp;&nbsp;--enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex&nbsp;&nbsp; --enable-mbstring --with-mcrypt --with-gd&nbsp;&nbsp;--enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl&nbsp;&nbsp;--enable-soap=shared --enable-pdo --enable-dom&nbsp;&nbsp;--enable-xmlwriter --with-pcre-regex&nbsp;&nbsp;--with-pear&nbsp;&nbsp;--enable-session&nbsp;&nbsp; --enable-hash&nbsp;&nbsp;--with-pdo-mysql=/usr/local/webserver/mysql --with-apxs2=/usr/local/webserver/apache2/bin/apxs
 </textarea><br/> make install ...安装时会在Apache2下安装libphp5.so等文件：<br/><textarea name="code" class="html" rows="15" cols="100">
Installing PHP SAPI module:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; apache2handler
/usr/local/webserver/apache2/build/instdso.sh SH_LIBTOOL=&#039;/usr/local/apr/build-1/libtool&#039; libphp5.la /usr/local/webserver/apache2/modules
/usr/local/apr/build-1/libtool --mode=install install libphp5.la /usr/local/webserver/apache2/modules/
libtool: install: install .libs/libphp5.so /usr/local/webserver/apache2/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/local/webserver/apache2/modules/libphp5.la
</textarea><br/><br/>在编译Apache下的PHP时出现一个can&#039;t find -lltdl的问题解决方法：<br/>/usr/bin/ld: cannot find 错误解决方法<br/>通常在软件编译时出现的usr/bin/ld: cannot find -lxxx的错误，主要的原因是库文件并没有导入的ld检索目录中。<br/>解决方式：<br/>1。确认库文件是否存在，比如-l123, 在/usr/lib, /usr/local/lib,或者其他自定义的lib下有无lib123.so, 如果只是存在lib123.so.1,<br/>那么可以通过ln -sv lib123.so.1&nbsp;&nbsp; lib123.so，建立一个连接重建lib123.so.<br/>2。检查/etc/ld.so.conf中的库文件路径是否正确，如果库文件不是使用系统路径，/usr/lib, /usr/local/lib, 那么必须在文件中加入。<br/>3。ldconfig 重建ld.so.cache文件，ld的库文件检索目录存放文件。尤其刚刚编译安装的软件，必须运行ldconfig，才能将新安装的<br/>库文件导入ld.so.cache.<br/>4。测试，gcc -l123 --verbose.<br/>参考：http://blog.siyebocai.cn/20100324_5p424qs7.html<br/>实践操作：<br/>/usr/lib/libltdl.so /usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [libphp5.la] 错误 1<br/>找找下面这些位置是否有这样的包？<br/>erro: Installed (but unpackaged) file(s) found:<br/>/usr/lib64/libltdl.a<br/>/usr/lib64/libltdl.la<br/>/usr/lib64/libltdl.so.3.1.0<br/><br/>Installed (but unpackaged) file(s) found:<br/>/usr/lib64/libltdl.a<br/>/usr/lib64/libltdl.la<br/>/usr/lib64/libltdl.so.3.1.0<br/>如果找不到，解决的方法基本很容易.<br/>#yum install libtool-ltdl-devel<br/>如果找到，我的情况：<br/>root@192.168.244.128:/# cd /;find . -name &quot;*libltdl.so*&quot;<br/>./usr/lib/libltdl.so.7.2.1<br/>./usr/lib/libltdl.so.7<br/>按上面的介绍来作出添加操作：<br/>1）检查/etc/ld.so.conf中的库文件路径是否正确，如果库文件不是使用系统路径，/usr/lib, /usr/local/lib, 那么必须在文件中加入。<br/>2）ldconfig 重建ld.so.cache文件，ld的库文件检索目录存放文件。尤其刚刚编译安装的软件，必须运行ldconfig，才能将新安装的<br/>库文件导入ld.so.cache.<br/>如下操作：<br/>vi /etc/ld.so.conf 添加一行：<br/>/usr/lib/ <br/>执行：&nbsp;&nbsp;ldconfig<br/>再次编译PHP即可！！！<br/>------------------------------------------------------------------------------------------------------------------------------------------------------------------<br/>还是不行啊？呵呵，那明明整上去了还不行再这样试试：<br/>第一步很容做到：yum -y install libtool libtool-ltdl； //这一步实在是没有那个库再说吧，略。直接第二步。<br/>root@192.168.244.128:/# ldconfig -p &#124;grep ltdl<br/>libltdl.so.7 (libc6) =&gt; /usr/lib/libltdl.so.7&nbsp;&nbsp;<br/>第二步由于PHP的configure指定的libltdl名为libltdl.so，为此我们只需添加一个名称连接：ln -s /usr/lib64/libltdl.so.3.1.4 /usr/lib64/libltdl.so ,如果不是64位则：<br/><textarea name="code" class="html" rows="15" cols="100">ln -sv libltdl.so.7 libltdl.so&nbsp;&nbsp;==&gt;ln -sv /usr/lib/libltdl.so.7 /usr/lib/libltdl.so</textarea>,其原始文件是：/usr/lib/libltdl.so.7.2.1 ，一个个都是软链接。<br/>http://blog.chinaunix.net/uid-20774942-id-3001010.html<br/>------------------------------------------------------------------------------------------------------------------------------------------------------------------<br/><br/>安装php并且打补丁（由于gd与iconv冲突，暂不编译gd库），于是在后来追加编译gd库<br/>进入目录php-5.2.10/ext/gd执行命令<br/>/usr/local/php/lib/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng&nbsp;&nbsp;--with-zlib-dir=/usr/local/zlib/ --with-freetype-dir=/usr/local/freetype<br/>make;make install<br/><br/>，最后，发现这个新生成的gd.so，和前面默认安的这个gd是一样的东东，现在还是不太明白他们所说的gd2和gd有什么大的区别，哈哈，上面这种方法提供了一条安gd.so的方法，也还是不小的收获。同时，以前这个PDO都是编译为so，而上面这个编译是直接编译进php的源码时就编译了，也是不错的收获。<br/>这次主要是把PHP模块Mysql的的PDO直接安装在了编译时，而不需要extension(;extension = &quot;pdo_mysql.so&quot;):<br/>root@192.168.225.128:~/software/php-5.3.10# php -m&#124;grep pdo<br/>PHP Warning:&nbsp;&nbsp;Module &#039;pdo_mysql&#039; already loaded in Unknown on line 0<br/>pdo_mysql<br/>pdo_sqlite<br/><br/><br/><br/><br/><br/>==============后期的方便操作的设置===================<br/>方便管理，显示IP等,如：jackxiang@72.46.128.82:~#<br/>vi ~/.bashrc <br/># .bashrc<br/><br/># User specific aliases and functions<br/><br/>alias rm=&#039;rm -i&#039;<br/>alias cp=&#039;cp -i&#039;<br/>alias mv=&#039;mv -i&#039;<br/>alias ll=&#039;ls -l&#039;<br/>alias la=&#039;ls -A&#039;<br/>alias vi=&#039;vim&#039;<br/>alias v=&#039;vim&#039;<br/><br/># Source global definitions<br/>if [ -f /etc/bashrc ]; then<br/>&nbsp;&nbsp;&nbsp;&nbsp;. /etc/bashrc<br/>fi<br/>ipL=`/sbin/ifconfig eth0&#124;grep &quot;inet addr:&quot;&#124;cut -d: -f 2&#124;cut -d&quot; &quot; -f1`<br/>export PS1=&quot;&#92;u@$ipL:&#92;w# &quot;<br/><br/>&nbsp;&nbsp;alias cdh=&quot;cd /usr/local/tads/htdocs/&quot;<br/>&nbsp;&nbsp;alias cnginx=&quot;cd /usr/local/webserver/nginx/&quot;<br/>&nbsp;&nbsp;alias chtdocs=&quot;cd /data0/htdocs/&quot;<br/>&nbsp;&nbsp;alias cphpuml=&quot;cd /root/software/PHP_UML-1.5.5/PHP/scripts&quot;<br/><br/>一些目录的快捷键：<br/>vi ~+/.bash_profile <br/># .bash_profile<br/><br/># Get the aliases and functions<br/>if [ -f ~/.bashrc ]; then<br/>&nbsp;&nbsp;&nbsp;&nbsp;. ~/.bashrc<br/>fi<br/><br/># User specific environment and startup programs<br/><br/>PATH=$PATH:$HOME/bin:/usr/local/webserver/php/bin:/usr/local/webserver/mysql/bin:/usr/local/webserver/memcached/bin:/usr/local/webserver/nginx/sbin:./usr/local/webserver/subversion/bin:/usr/local/webserver/python/bin:/home/webdev/bin;<br/>export PATH<br/>unset USERNAME<br/>alias chtdocs=&#039;cd /data0/htdocs&#039;<br/>alias cphp=&#039;cd /usr/local/webserver/php&#039;<br/>alias cmysql=&#039;cd /usr/local/webserver/mysql&#039;<br/>alias capache=&#039;cd /usr/local/webserver/apache&#039;<br/>alias cblog=&#039;cd /data0/htdocs/blog&#039;<br/>alias h=&#039;history&#039;<br/><br/><br/>Vim的一些设置等：<br/>vi ~+/.vimrc<br/>syntax on<br/>set tabstop=4<br/>set softtabstop=4<br/>set shiftwidth=4<br/>set autoindent<br/>set cinoptions=&#123;0,1s,t0,n-2,p2s,(03s,=.5s,&gt;1s,=1s,:1s<br/>set nu<br/>if &amp;term==&quot;xterm&quot;<br/>&nbsp;&nbsp;set t_Co=8<br/>&nbsp;&nbsp;set t_Sb=^[[4%dm<br/>&nbsp;&nbsp;set t_Sf=^[[3%dm<br/>endif<br/><br/><br/>behave mswin<br/>colo murphy<br/>set fileencodings=utf-8,gb2312,gbk,gb18030 <br/>set termencoding=utf-8<br/>set fileformats=unix<br/>set fileencoding=utf-8<br/><br/><br/><br/>au FileType php call AddPHPFuncList()<br/>function AddPHPFuncList()<br/>set dictionary-=/root/.vim/ExtraVim/php_funclist.txt dictionary+=/root/.vim/ExtraVim/php_funclist.txt<br/>set complete-=k complete+=k<br/>endfunction<br/><br/>map &lt;F10&gt; : NERDTreeToggle&lt;CR&gt;<br/>map &lt;F12&gt; ::TlistToggle&lt;CR&gt;<br/>let NERDTreeWinPos = &quot;right&quot; &quot;where NERD tree window is placed on the screen<br/>let Tlist_Enable_Fold_Column = 0<br/>let Tlist_Exit_OnlyWindow = 0<br/>let Tlist_File_Fold_Auto_Close = 0<br/>let Tlist_GainFocus_On_ToggleOpen = 1<br/>let Tlist_Hightlight_Tag_On_BufEnter = 1<br/>let Tlist_Inc_Winwidth = 0<br/>let Tlist_Max_Submenu_Items = 1<br/>let Tlist_Max_Tag_Length = 30<br/>let Tlist_Process_File_Always = 0<br/>let Tlist_Show_Menu = 0<br/>let Tlist_Show_One_File = 0<br/>let Tlist_Sort_Type = &quot;order&quot;<br/>let Tlist_Use_Horiz_Window = 0<br/>let Tlist_Use_Right_Window = 1<br/>let Tlist_WinWidth = 40<br/>let tlist_php_settings = &#039;php;c:class;i:interfaces;d:constant;f:function&#039;<br/><br/><br/><br/><br/><br/>eaccelerator的小生产配置备案：<br/>[Zend]<br/>zend_optimizer.optimization_level=15<br/>zend_extension=&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&quot;<br/>eaccelerator.shm_size=&quot;64&quot;<br/>eaccelerator.cache_dir=&quot;/data/eaccelerator&quot;<br/>eaccelerator.enable=&quot;1&quot; <br/>eaccelerator.optimizer=&quot;1&quot; <br/>eaccelerator.check_mtime=&quot;1&quot;<br/>eaccelerator.debug=&quot;0&quot;<br/>eaccelerator.log_file = &quot;/var/log/httpd/eaccelerator_log&quot;<br/>eaccelerator.filter=&quot;&quot;<br/>eaccelerator.shm_max=&quot;0&quot;<br/>eaccelerator.shm_ttl=&quot;0&quot; <br/>eaccelerator.shm_prune_period=&quot;0&quot;<br/>eaccelerator.shm_only=&quot;0&quot;<br/><br/><br/>YAML扩展：http://jackxiang.com/post/4431/<br/>Xdebug：http://jackxiang.com/post/4675/<br/><br/>更加清晰的参考：<br/>http://www.osyunwei.com/archives/4924.html<br/>http://www.ypgogo.com/world/pearl/id/13000<br/><br/>_____________________PHP5.4以上非fastCGI和apche结合支持上传进度的实践之重新配置Apache____________________________<br/>目的：想实现PHP5.4的进度progress的上传，搞了个nginx的，后来一老外说这Nginx玩意在获取进度时获取不到，还得用传统的Apache那一套。Add Time：14/3/27 星期四<br/>一）给Apache2重新编译下PHP：（像什么GD库，Mysql先省了）<br/>./configure --prefix=/usr/local/webserver/php5.4ForApache -with-apxs2=/usr/local/webserver/apache2/bin/apxs --with-curl --with-mcrypt --enable-mbstring&nbsp;&nbsp;&nbsp;&nbsp;--enable-pdo --with-iconv-dir=/usr/local/libiconv <br/><br/>二）make ZEND_EXTRA_LIBS=&#039;-liconv&#039;&nbsp;&nbsp;&amp;&amp; make install<br/>libtool: install: install .libs/libphp5.so /usr/local/webserver/apache2/modules/libphp5.so<br/>libtool: install: install .libs/libphp5.lai /usr/local/webserver/apache2/modules/libphp5.la<br/><br/><br/>三）再次检查下httpd.conf的配置情况：<br/>&lt;IfModule mime_module&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>TypesConfig conf/mime.types&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>LoadModule php5_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modules/libphp5.so&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>AddType application/x-httpd-php .php&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>AddType application/x-httpd-php-source .phps&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>启动Apache，开始测试。<br/>root@192.168.0.6:/usr/local/webserver/apache2/bin# ./httpd -k start<br/>httpd: Syntax error on line 388 of /usr/local/webserver/apache2/conf/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/webserver/apache2/modules/libphp5.so: undefined symbol: zend_parse_parameters<br/>解决办法：<br/>在新的服务器（centos 6.3）编译安装完php-5.4.8，再配置好php.ini和httpd.conf后，启动apache-2.4.3的时候，命令执行/usr/local/apache2/bin/apachectl start时，提示：<br/>httpd: Syntax error on line 146 of /etc/httpd/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: zend_parse_parameters<br/>通过搜索发现，说是缺少bison。<br/>如果通过rpm -qa&#124;grep bison发现没有安装bison，安装bison即可。centos可以用yum install bison<br/>rpm -qa&#124;grep bison 是：bison-2.4.1-5.el6.i686，但是我发现已经安装了bison-2.4.1,rpm -e bison-2.4.1-5.el6.i686。最后实在是没办法了，下载了bison-2.5的rpm包直接安装。<br/>[root@localhost ~]#&nbsp;&nbsp;wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz<br/>[root@localhost ~]#&nbsp;&nbsp;tar -zxvf bison-2.5.tar.gz<br/>[root@localhost ~]#&nbsp;&nbsp;cd bison-2.5<br/>[root@localhost ~]#&nbsp;&nbsp;./configure<br/>[root@localhost ~]#&nbsp;&nbsp;make &amp;&amp; make install<br/>再重新编译安装了PHP[实践发现在重新编译PHP时要注意：make clean再编译，后才能启动Apache2并支持PHP5.4.26]。然后/usr/local/apache2/webserver/bin/apachectl start启动Apache。惊奇的发现可以正常启动了，测试了下PHP网页，可以正常访问。<br/>来自：http://www.myxzy.com/post-272.html<br/>1）配置好后，测试上传进度占比的PHP自己带的进度实践来源：<br/>（1）http://www.pureweber.com/article/php-upload-progress/<br/>（2）https://github.com/pureweber/samples/blob/master/php-upload-progress/upload.php<br/>2）配置好后，测试上传进度占比的Flash实践来源：http://jackxiang.com/post/6939/
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [国内VPS]CentOS6.2下安装php5.4.0,mysql-5.5.21,nginx-1.0.12的步骤记录，PHP5.4与Apache结合实现上传进度的安装配置，Nginx开机启动自动输入SSL启动密码。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>