<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>【知行合一】-Poople&#039;s Blog &#187; PHP</title>
	<atom:link href="http://99dev.net/archives/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://99dev.net</link>
	<description>智巧终归庸俗，雄谋只余虚话</description>
	<lastBuildDate>Wed, 12 Oct 2011 01:19:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux获取程序编译参数</title>
		<link>http://99dev.net/archives/974</link>
		<comments>http://99dev.net/archives/974#comments</comments>
		<pubDate>Thu, 02 Dec 2010 09:23:54 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[其他Linux技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/?p=974</guid>
		<description><![CDATA[作为系统管理员，经常会碰到这样一个场景：刚接手应用系统不久，业务扩展迅速，老板要求你再搭建N个应用环境，并希望尽量与运行中的平台一致。
犯难的是，前同事留下的文档不详细，没有关于几个主要Service的编译参数。这时你就必须设法取得信息。
1.通过软件包自己的version参数或者debug工具
例如，MySQL软件包中的mysqlbug，执行该工具，将返回debug信息，过滤出其中的Configure command代码块即可
<span class="readmore"><a href="http://99dev.net/archives/974" title="Linux获取程序编译参数" target="_blank">阅读全文——共2730字</a></span>]]></description>
			<content:encoded><![CDATA[<p>作为系统管理员，经常会碰到这样一个场景：刚接手应用系统不久，业务扩展迅速，老板要求你再搭建N个应用环境，并希望尽量与运行中的平台一致。<br />
犯难的是，前同事留下的文档不详细，没有关于几个主要Service的编译参数。这时你就必须设法取得信息。</p>
<p><strong>1.通过软件包自己的version参数或者debug工具</strong><br />
例如，MySQL软件包中的mysqlbug，执行该工具，将返回debug信息，过滤出其中的Configure command代码块即可<br />
<span id="more-974"></span></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Configure command: .<span style="color: #000000; font-weight: bold;">/</span>configure &nbsp;<span style="color: #ff0000;">'--disable-shared'</span> <span style="color: #ff0000;">'--with-server-suffix=-community'</span> <span style="color: #ff0000;">'--without-plugin-ndbcluster'</span> <span style="color: #ff0000;">'--with-plugin-innobase'</span> <span style="color: #ff0000;">'<br />
--with-plugin-partition'</span> <span style="color: #ff0000;">'--with-plugin-csv'</span> <span style="color: #ff0000;">'--with-plugin-archive'</span> <span style="color: #ff0000;">'--with-plugin-blackhole'</span> <span style="color: #ff0000;">'--with-plugin-federated'</span> <span style="color: #ff0000;">'--without-plugin-da<br />
emon_example'</span> <span style="color: #ff0000;">'--without-plugin-ftexample'</span> <span style="color: #ff0000;">'--without-plugin-example'</span> <span style="color: #ff0000;">'--with-embedded-server'</span> <span style="color: #ff0000;">'--without-bench'</span> <span style="color: #ff0000;">'--with-big-tables'</span> <span style="color: #ff0000;">'--enabl<br />
e-assembler'</span> <span style="color: #ff0000;">'--enable-local-infile'</span> <span style="color: #ff0000;">'--with-mysqld-user=mysql'</span> <span style="color: #ff0000;">'--with-unix-socket-path=/var/lib/mysql/mysql.sock'</span> <span style="color: #ff0000;">'--with-pic'</span> <span style="color: #ff0000;">'--prefix=/'</span><br />
<span style="color: #ff0000;">'--with-extra-charsets=complex'</span> <span style="color: #ff0000;">'--with-ssl'</span> <span style="color: #ff0000;">'--exec-prefix=/usr'</span> <span style="color: #ff0000;">'--libexecdir=/usr/sbin'</span> <span style="color: #ff0000;">'--libdir=/usr/lib'</span> <span style="color: #ff0000;">'--sysconfdir=/etc'</span> <span style="color: #ff0000;">'--datadi<br />
r=/usr/share'</span> <span style="color: #ff0000;">'--localstatedir=/var/lib/mysql'</span> <span style="color: #ff0000;">'--infodir=/usr/share/info'</span> <span style="color: #ff0000;">'--includedir=/usr/include'</span> <span style="color: #ff0000;">'--mandir=/usr/share/man'</span> <span style="color: #ff0000;">'--enable-th<br />
read-safe-client'</span> <span style="color: #ff0000;">'--with-comment=MySQL Community Server (GPL)'</span> <span style="color: #ff0000;">'--with-readline'</span> <span style="color: #ff0000;">'--with-zlib-dir=bundled'</span> <span style="color: #ff0000;">'CC=gcc'</span> <span style="color: #ff0000;">'CFLAGS=-O2 -g -pipe -Wa<br />
ll -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tab<br />
les'</span> <span style="color: #ff0000;">'LDFLAGS='</span> <span style="color: #ff0000;">'CXX=gcc'</span> <span style="color: #ff0000;">'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32<br />
-march=i386 -mtune=generic -fasynchronous-unwind-tables -felide-constructors -fno-exceptions -fno-rtti '</span></div></td></tr></tbody></table></div>
<p>附上其他常用service编译参数的查看方法</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">查看nginx编译参数：nginx <span style="color: #660033;">-V</span><br />
查看apache编译参数：<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>config.nice<br />
查看mysql编译参数：mysqlbug<br />
查看php编译参数：php <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> configure</div></td></tr></tbody></table></div>
<p>All Tested OK！</p>
<p><strong>2.利用SRPM包的spec文件获取build信息</strong><br />
以上查看Apache编译的方法，只能service是采用tar.gz安装的环境。如果是rpm安装，利用该方法是行不通的，rpm安装的service，并不会留下config.nice。<br />
解决办法就是搜索该软件是否有发布SRPM(.src.rpm后缀)，将其解压，查看spec文件中的%build代码块。</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">%</span>build<br />
......<br />
..<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">-C</span> \<br />
<span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd \<br />
<span style="color: #660033;">--with-apr</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apr-config \<br />
<span style="color: #660033;">--with-apr-util</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apu-config \<br />
<span style="color: #660033;">--exec-prefix</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_prefix<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--bindir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_bindir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--sbindir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sbindir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--mandir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_mandir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--libdir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_libdir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf \<br />
<span style="color: #660033;">--includedir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_includedir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd \<br />
<span style="color: #660033;">--libexecdir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_libdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules \<br />
<span style="color: #660033;">--datadir</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>contentdir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--with-mpm</span>=<span style="color: #007800;">$mpm</span> \<br />
<span style="color: #660033;">--enable-suexec</span> <span style="color: #660033;">--with-suexec</span> \<br />
<span style="color: #660033;">--with-suexec-caller</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>suexec_caller<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--with-suexec-docroot</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>contentdir<span style="color: #7a0874; font-weight: bold;">&#125;</span> \<br />
<span style="color: #660033;">--with-suexec-logfile</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_localstatedir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>suexec.log \<br />
<span style="color: #660033;">--with-suexec-bin</span>=<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sbindir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>suexec \<br />
<span style="color: #660033;">--with-suexec-uidmin</span>=<span style="color: #000000;">500</span> <span style="color: #660033;">--with-suexec-gidmin</span>=<span style="color: #000000;">500</span> \<br />
<span style="color: #660033;">--with-devrandom</span> \<br />
<span style="color: #660033;">--with-ldap</span> <span style="color: #660033;">--enable-ldap</span> <span style="color: #660033;">--enable-auth-ldap</span> \<br />
<span style="color: #660033;">--enable-cache</span> <span style="color: #660033;">--enable-disk-cache</span> <span style="color: #660033;">--enable-mem-cache</span> <span style="color: #660033;">--enable-file-cache</span> \<br />
<span style="color: #660033;">--enable-ssl</span> <span style="color: #660033;">--with-ssl</span> \<br />
<span style="color: #660033;">--enable-deflate</span> <span style="color: #660033;">--enable-cgid</span> \<br />
<span style="color: #660033;">--enable-proxy</span> <span style="color: #660033;">--enable-proxy-connect</span> \<br />
<span style="color: #660033;">--enable-proxy-http</span> <span style="color: #660033;">--enable-proxy-ftp</span> \</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/974/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]不能利用php的mail函数发送邮件的解决</title>
		<link>http://99dev.net/archives/844</link>
		<comments>http://99dev.net/archives/844#comments</comments>
		<pubDate>Thu, 29 Apr 2010 07:45:38 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/archives/844</guid>
		<description><![CDATA[程序员反映在sun.xmnn.cn(192.168.96.55)不能利用PHP的mail()函数发送邮件。已解决。
设置步骤如下，

1.启动sendmail服务 /etc/init.d/sendmail start
<span class="readmore"><a href="http://99dev.net/archives/844" title="[Original]不能利用php的mail函数发送邮件的解决" target="_blank">阅读全文——共577字</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: medium;">程序员反映在sun.xmnn.cn(192.168.96.55)不能利用PHP的mail()函数发送邮件。已解决。</span></p>
<p><span style="font-size: medium;">设置步骤如下，</span></p>
<p><span id="more-844"></span></p>
<p><span style="font-size: medium;">1.启动sendmail服务 /etc/init.d/sendmail start</span></p>
<p><span style="font-size: medium;">2.将sendmail服务加入开机启动项 chkconfig sendmail on</span></p>
<p>3.编辑access文件,加入以下域</p>
<p>vim /etc/mail/access</p>
<p>Connect:xmnn.cn RELAY</p>
<p>4.编辑php-fpm.conf文件，去除sendmail_path键值的注释符号</p>
<p>vim /data/php/etc/php-fpm.conf</p>
<p>&lt;value name=”sendmail_path”&gt;/usr/sbin/sendmail -t -i&lt;/value&gt;</p>
<p>5.编辑php.ini文件，设置sendmai_path变量</p>
<p>vim /data/php/etc/php.ini</p>
<p>sendmail_path = /usr/sbin/sendmail -t -i</p>
<p>6.该台服务器有设置nameserver。如没有的话，请编辑/etc/resolv.conf</p>
<p>加入以下内容</p>
<p>nameserver 202.101.103.55</p>
<p>nameserver 202.101.103.54</p>
<p>7.另，利用命令行测试系统sendmail是否可用，请参考<a href="http://linux.vbird.org/linux_server/0380sendmail.php">此文章</a>中“Linux 下使用 telnet 功能”小节。</p>
<p>附部分测试程序</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'POST'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$to</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;hery78567650@163.com&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Test Mail Send by XMNN.Apps&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Hello! This is a test sent by php.apps on sunbbs. Poople&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$email</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sun@xmnn.cn&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$from</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span><br />
<br />
<span style="color: #0000ff;">&quot;CC: 7215030@qq.com&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span><span style="color: #000088;">$subject</span><span style="color: #339933;">,</span><span style="color: #000088;">$message</span><span style="color: #339933;">,</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;????&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/844/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]PHP服务器时间校对</title>
		<link>http://99dev.net/archives/720</link>
		<comments>http://99dev.net/archives/720#comments</comments>
		<pubDate>Mon, 14 Dec 2009 03:33:02 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[其他Linux技术]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/archives/720</guid>
		<description><![CDATA[一些LAMP论坛，经常遇到这样的问题，页面显示时间和本地实际时间相差8小时或者更多 
1.修改系统市区设置
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 

<span class="readmore"><a href="http://99dev.net/archives/720" title="[Original]PHP服务器时间校对" target="_blank">阅读全文——共180字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一些LAMP论坛，经常遇到这样的问题，页面显示时间和本地实际时间相差8小时或者更多 </p>
<p>1.修改系统市区设置</p>
<blockquote><p>cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime </p>
</blockquote>
<p>2.使用ntpdate同步服务器时间</p>
<blockquote><p>ntpdate time.api.bz </p>
</blockquote>
<p> <span id="more-720"></span>
<p>3.执行测试php脚本<font color="#0000ff">time.php</font></p>
<blockquote><p>&lt;?php      <br />echo date(&#8216;G:i:s&#8217;);       <br />?&gt;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/720/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]Linux+Zeus+php.fcgi配置过程</title>
		<link>http://99dev.net/archives/714</link>
		<comments>http://99dev.net/archives/714#comments</comments>
		<pubDate>Thu, 26 Nov 2009 08:48:45 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[系统架构]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zeus]]></category>

		<guid isPermaLink="false">http://99dev.net/archives/714</guid>
		<description><![CDATA[1.系统环境配置
配置中文支持
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
<span class="readmore"><a href="http://99dev.net/archives/714" title="[Original]Linux+Zeus+php.fcgi配置过程" target="_blank">阅读全文——共2321字</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: medium"><strong>1.系统环境配置</strong></span></p>
<p><span style="font-size: x-small"><strong>配置中文支持</strong></span><br />
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm<br />
rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm</p>
<p><span style="font-size: x-small"><strong>修改Hostname</strong></span><br />
1文件中的HOSTNAME，改为你希望的名字<br />
2，/etc/hosts文件中，把所有原来机器名修改为新的机器名</p>
<p><span style="font-size: x-small"><strong>清除原服务组件</strong></span></p>
<p><span id="more-714"></span>1.kill所有nginx/php/mysql进程</p>
<p>2.删除服务组件所在目录</p>
<p>3.删除启动项，一般位于setup菜单中和/etc/rc.local文件中</p>
<p><span style="font-size: medium"><strong>2.服务组件安装</strong></span></p>
<p>安装MySQL和PHP组件，这部分大同小异，参考张宴的文章<a href="http://http://blog.s135.com/nginx_php_v5/" target="_blank">《Nginx 0.7.x + PHP 5.2.10（FastCGI）搭建胜过Apache十倍的Web服务器（第5版）》</a></p>
<blockquote><p>Tips：Screen</p>
<p>配置时。所在网络环境相当不稳定，经常发生掉线的情况。为避免掉线重新登陆，引起的正在编辑的文件被锁死的问题，建议用screen开启一个不掉线的会话。screnn的用法参考：<a title="http://www.ibm.com/developerworks/cn/linux/l-cn-screen/" href="http://www.ibm.com/developerworks/cn/linux/l-cn-screen/">http://www.ibm.com/developerworks/cn/linux/l-cn-screen/</a></p></blockquote>
<p><strong><span style="font-size: medium">3.服务组件配置调试</span></strong></p>
<p><span style="font-size: x-small"><strong>·PHP编译配置</strong></span></p>
<blockquote><p>PHP编译参数<br />
&#8216;./configure&#8217; &#8216;&#8211;prefix=/usr/local/webserver/php&#8217; &#8216;&#8211;with-config-file-path=/usr/local/webserver/php/etc&#8217; &#8216;&#8211;with-mysql=/usr&#8217; &#8216;&#8211;with-mysqli=/usr/bin/mysql_config&#8217; &#8216;&#8211;with-iconv-dir=/usr/local&#8217; &#8216;&#8211;with-freetype-dir&#8217; &#8216;&#8211;with-jpeg-dir&#8217; &#8216;&#8211;with-png-dir&#8217; &#8216;&#8211;with-zlib&#8217; &#8216;&#8211;with-libxml-dir=/usr&#8217; &#8216;&#8211;enable-xml&#8217; &#8216;&#8211;disable-rpath&#8217; &#8216;&#8211;enable-discard-path&#8217; &#8216;&#8211;enable-safe-mode&#8217; &#8216;&#8211;enable-bcmath&#8217; &#8216;&#8211;enable-shmop&#8217; &#8216;&#8211;enable-sysvsem&#8217; &#8216;&#8211;enable-inline-optimization&#8217; &#8216;&#8211;with-curl&#8217; &#8216;&#8211;with-curlwrappers&#8217; &#8216;&#8211;enable-mbregex&#8217; &#8216;&#8211;enable-fastcgi&#8217; &#8216;&#8211;enable-fpm&#8217; &#8216;&#8211;enable-force-cgi-redirect&#8217; &#8216;&#8211;enable-mbstring&#8217; &#8216;&#8211;with-mcrypt&#8217; &#8216;&#8211;with-gd&#8217; &#8216;&#8211;enable-gd-native-ttf&#8217; &#8216;&#8211;with-openssl&#8217; &#8216;&#8211;with-mhash&#8217; &#8216;&#8211;enable-pcntl&#8217; &#8216;&#8211;enable-sockets&#8217; &#8216;&#8211;with-ldap&#8217; &#8216;&#8211;with-ldap-sasl&#8217; &#8216;&#8211;with-xmlrpc&#8217; &#8216;&#8211;enable-zip&#8217; &#8216;&#8211;enable-soap&#8217; &#8216;&#8211;without-pear&#8217;</p></blockquote>
<p><span style="font-size: x-small">[PHP]编译过程中发生错误-1</span></p>
<blockquote><p>configure: error: Cannot find MySQL header files under /usr</p></blockquote>
<p><span style="font-size: x-small">[PHP]缺少mysql的头文件，需安装以下依赖包</span></p>
<blockquote><p>rpm -ivh MySQL-devel-4.1.12-1.i386.rpm</p></blockquote>
<p>[PHP]编译过程中发生错误-2</p>
<blockquote><p>error: mysql configure failed. Please check config.log for more information.</p></blockquote>
<p>[PHP]64位系统，需指定以下环境变量</p>
<blockquote><p>export LDFLAGS=-L/usr/lib64/mysql</p></blockquote>
<p><strong><span style="font-size: x-small">·Zeus编译配置</span></strong></p>
<p><span style="font-size: x-small">[Zeus]Zeus使用中遇到问题，web端口已打开，访问测试页面却显示空白。</span></p>
<blockquote><p>解决办法：Current Configuration -〉 Bind address    125.65.45.18</p></blockquote>
<p><span style="font-size: x-small"><strong>不使用Zeus自带的PHP，改用我们自己编译的新版本。</strong></span></p>
<blockquote><p>在Current Configuration -〉PHP置为Disable</p></blockquote>
<blockquote><p>在API Support-&gt;FastCGI<br />
Configuring FastCGI Remote Responders<br />
Adding a FastCGI Remote Responder</p>
<p>Directory name: /usr/local/bin/php<br />
Location: Machine name: localhost<br />
Port: 8002<br />
Additional methods supported?: none</p></blockquote>
<blockquote><p>在URL Handling-&gt;Handlers-&gt;Adding a Handler<br />
File Extension: *.php<br />
Specify the path and filename of the handler, relative to the document root: /usr/local/bin/php<br />
HTTP 404 errors are handled by: The handler</p></blockquote>
<p><strong>在Zeus/rc.d目录下，新建一个S05php可执行脚本，<a href="http://99dev.net/wp-content/uploads/2009/11/s05php">s05php</a></strong></p>
<p><strong>运行rc.d/S05php start，初始化php.fcgi进程</strong></p>
<p><strong>在www目录下，放置phpinfo.php页面测试</strong></p>
<blockquote><p>&lt;?phpinfo();?&gt;</p></blockquote>
<p><span style="font-size: x-small;"><em></em></span></p>
<p><span style="font-size: x-small;"><em>&lt;!&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;Notice&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&gt;<br />
</em></span><span style="font-size: x-small;">1.Zeus基于Web界面配置，切记在输入任何参数时，使用英文输入法。<br />
2.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/714/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[Original]已解决：ArchLinux上编译AMP环境错误</title>
		<link>http://99dev.net/archives/281</link>
		<comments>http://99dev.net/archives/281#comments</comments>
		<pubDate>Thu, 13 Nov 2008 10:34:01 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/?p=281</guid>
		<description><![CDATA[按照M(MySQL)-A(Apache)-P(PHP)的顺序，从源代码编译安装。在未安装PHP之前，Apache可以正常开启。安装完PHP，apache restart出现如下错误：
[root@myhost php]# /usr/local/httpd/bin/apachectl stop
Syntax error on line 262 of /usr/local/httpd/conf/httpd.conf:
Cannot load /usr/local/httpd/modules/libphp5.so into server: /usr/local/httpd/modules/libphp5.so: undefined symbol: sqlite3ExprDeleteGoogle上很多人说是由于libphp5的权限问题和SeLinux安全问题，分析一下，可以否定这2种说法：
<span class="readmore"><a href="http://99dev.net/archives/281" title="[Original]已解决：ArchLinux上编译AMP环境错误" target="_blank">阅读全文——共577字</a></span>]]></description>
			<content:encoded><![CDATA[<p>按照M(MySQL)-A(Apache)-P(PHP)的顺序，从源代码编译安装。在未安装PHP之前，Apache可以正常开启。安装完PHP，apache restart出现如下错误：</p>
<p>[root@myhost php]# /usr/local/httpd/bin/apachectl stop<br />
Syntax error on line 262 of /usr/local/httpd/conf/httpd.conf:<br />
Cannot load /usr/local/httpd/modules/libphp5.so into server: /usr/local/httpd/modules/libphp5.so: undefined symbol: sqlite3ExprDelete<span id="more-281"></span>Google上很多人说是由于libphp5的权限问题和SeLinux安全问题，分析一下，可以否定这2种说法：</p>
<p>1.libphp5.so已经是755权限</p>
<p>2.ArchLinux是轻量级Linux，没有集成SeLinux安装功能</p>
<p>依照以往在其他Linux中的经验，问题应该出在最后的PHP之上，重新编译应该OK</p>
<p>依次执行make clean ; ./configure ; make ; make install</p>
<p>重新启动Apache，/path_apache/bin/apachectl start ,OK</p>
<p>放上phpinfo，测试PHP调用正常</p>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/281/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]快速建站-开源CMS利器：Joomla</title>
		<link>http://99dev.net/archives/268</link>
		<comments>http://99dev.net/archives/268#comments</comments>
		<pubDate>Tue, 28 Oct 2008 08:46:24 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[善用佳软]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/?p=268</guid>
		<description><![CDATA[Joomla在国外的软件大赛中屡获大奖，是一款功能丰富、插件齐全的优秀CMS（内容管理系统）。发挥其众多的模板/组件/插件/模块的功能，你可以在短短数天之内，完成一个样式新颖、功能齐全、内容丰富的互联网站点。
前几天，利用业余时间做了个站点，新师缘教育，前前后后耗费的时间大概就40多个小时（含系统选择、熟悉的时间）。
目前最新的版本为Joomla 1.5.7，本次选用的是JoomlaGate的深入汉化版http://www.joomlagate.com/component/option,com_remository/Itemid,48/func,fileinfo/id,541/
 
<span class="readmore"><a href="http://99dev.net/archives/268" title="[Original]快速建站-开源CMS利器：Joomla" target="_blank">阅读全文——共1057字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Joomla在国外的软件大赛中屡获大奖，是一款功能丰富、插件齐全的优秀CMS（内容管理系统）。发挥其众多的模板/组件/插件/模块的功能，你可以在短短数天之内，完成一个样式新颖、功能齐全、内容丰富的互联网站点。<br />
前几天，利用业余时间做了个站点，<a href="http://513xsy.cn" target="_blank">新师缘教育</a>，前前后后耗费的时间大概就40多个小时（含系统选择、熟悉的时间）。</p>
<p><span id="more-268"></span>目前最新的版本为Joomla 1.5.7，本次选用的是JoomlaGate的深入汉化版<a href="http://www.joomlagate.com/component/option,com_remository/Itemid,48/func,fileinfo/id,541/">http://www.joomlagate.com/component/option,com_remository/Itemid,48/func,fileinfo/id,541/</a><br />
 <br />
选择PHP空间<br />
个人偏好西部数码 的空间，随个人喜好，喜欢自己的空间商，没有定性的要求。<br />
 <br />
如果你要熟悉系统，在安装的过程，不要安装示例数据比较好，示例数据往往让新手眼花缭乱，不清楚哪个区块应该在哪里（Joomla中，把每个页面分割成多个区块，每个区块一般就显示某个功能的内容，如公告）。<br />
网站外围扩展<br />
 <br />
前台模块<br />
·mod_footer<br />
页脚信息，也就是一般所说的版权信息，一般包含公司联系方式，开发者信息，网站备案号<br />
·mod_newsflashscroller_pro<br />
一个可以让指定单元的新闻滚动的模块，这里用作公告栏<br />
·mod_mainmenu<br />
主菜单，我们常说的导航菜单，系统内置的，无需安装<br />
·mod_newsflash<br />
最近新闻模块，在页面指定位置显示提交的新闻。<br />
 <br />
功能插件<br />
·Editor &#8211; JoomlaFCK<br />
最好的编辑器，用于文字内容的提交、修改。最接近Office 2003使用习惯的编辑器。<br />
·System &#8211; Legacy<br />
兼容模块，使老的扩展（适用于1.0版本的）可以应用在1.5系统<br />
·其他插件-系统内置<br />
 <br />
前台模板<br />
· JA_Corona<br />
事关个人品位，这里不推荐，只给出我采用的版本供参考<br />
 <br />
 <br />
注意事项：<br />
部分扩展在不同浏览器中会有异常，调试的时候至少要考虑IE6、IE7和Firefox的兼容性，适当修改html和css样式，达到每个浏览器效果接近。<br />
 <br />
全局设置中，页面压缩功能一定要启用，浏览加速效果非常明显<br />
其他推荐<br />
Drupal 风投正劲的CMS，结构清晰，功能插件和Joomla相差不大<br />
CMS Made Simple 如其名，这是一款轻量级CMS，保留CMS应用的内容和新闻管理，摒弃其他多余功能，操作简单。站点运行速度快，适合做交互内容少的站点。<br />
vivvo 商业化的CMS，主题做得非常靓，有汉化破解版，汉化程度不是很完整，适合对PHP代码熟悉的程序员使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/268/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]PHP动态扩展模块</title>
		<link>http://99dev.net/archives/263</link>
		<comments>http://99dev.net/archives/263#comments</comments>
		<pubDate>Wed, 15 Oct 2008 08:02:43 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/archives/263</guid>
		<description><![CDATA[安装Magento电子商务系统，需要mcrypt.so模块。在Windows环境下，很好办，Windows下的lib/php目录一般是完整的，只需在php.ini里将;号去掉即可。在Linux环境下，这些模块一般是按需定制的。为了得到一个新模块，往往要重新编译整个PHP，耗时长，又容易出错。

Apache拥有apxs动态扩展工具，PHP同样有类似的东西。以下给个范例
[root@www2 php-5.2.4]# cd ext/mcrypt/  #进入模块源码目录ext/mcrypt
<span class="readmore"><a href="http://99dev.net/archives/263" title="[Original]PHP动态扩展模块" target="_blank">阅读全文——共1021字</a></span>]]></description>
			<content:encoded><![CDATA[<p>安装Magento电子商务系统，需要mcrypt.so模块。在Windows环境下，很好办，Windows下的lib/php目录一般是完整的，只需在php.ini里将;号去掉即可。在Linux环境下，这些模块一般是按需定制的。为了得到一个新模块，往往要重新编译整个PHP，耗时长，又容易出错。</p>
<p><span id="more-263"></span></p>
<p>Apache拥有apxs动态扩展工具，PHP同样有类似的东西。以下给个范例</p>
<p>[root@www2 php-5.2.4]# cd ext/mcrypt/  <span style="color: #000080;">#进入模块源码目录ext/mcrypt</span><br />
[root@www2 mcrypt]# phpize  #创建configure文件<br />
PHP Api Version:         20020918<br />
Zend Module Api No:      20020429<br />
Zend Extension Api No:   20050606</p>
<p>[root@www2 mcrypt]# ./configure  &#8211;with-mcrypt  <span style="color: #000080;"> #指定编译mcrypt</span></p>
<p>&#8211;with-php-config=/usr/local/php5/bin/php-config </p>
<p>[root@www2 mcrypt]# make<br />
/bin/sh /root/download/php-5.2.4/ext/mcrypt/libtool &#8211;mode=install cp ./mcrypt.la /root/download/php-5.2.4/ext/mcrypt/modules<br />
cp ./.libs/mcrypt.so /root/download/php-5.2.4/ext/mcrypt/modules/mcrypt.so<br />
cp ./.libs/mcrypt.lai /root/download/php-5.2.4/ext/mcrypt/modules/mcrypt.la<br />
PATH=”$PATH:/sbin” ldconfig -n /root/download/php-5.2.4/ext/mcrypt/modules<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<span style="color: #ff0000;">Libraries have been installed in:<br />
   /root/download/php-5.2.4/ext/mcrypt/modules  </span><span style="color: #000080;">#成功编译，得到mcrypt.so</span></p>
<p><span style="color: #000000;">接下来需要做的就是复制该模块到目标位置，并在php.ini中启用之。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/263/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Original]PHP在线解压zip文件</title>
		<link>http://99dev.net/archives/114</link>
		<comments>http://99dev.net/archives/114#comments</comments>
		<pubDate>Wed, 24 Sep 2008 07:22:06 +0000</pubDate>
		<dc:creator>蒼</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://99dev.net/archives/114</guid>
		<description><![CDATA[之前有发过一帖《虚拟主机在线解压文件的实现》，采用的是phpshell，通用性较好，能解压zip/tar.gz/tat.bz2等等(依赖于Linux/Unix系统的Uncompress Tools)，有个缺点就是，需要用户掌握基本的unix command。这里介绍另一种在线解压方式，只要简单的点击即可实现。
·实现步骤 
下载php脚本unzip.php
修改unzip.php里面的$password = “666666&#8243;;字符串，在之后的上传解压过程会用得到
<span class="readmore"><a href="http://99dev.net/archives/114" title="[Original]PHP在线解压zip文件" target="_blank">阅读全文——共355字</a></span>]]></description>
			<content:encoded><![CDATA[<p>之前有发过一帖<a href="http://99dev.net/archives/80" target="_blank">《虚拟主机在线解压文件的实现》</a>，采用的是phpshell，通用性较好，能解压zip/tar.gz/tat.bz2等等(依赖于Linux/Unix系统的Uncompress Tools)，有个缺点就是，需要用户掌握基本的unix command。这里介绍另一种在线解压方式，只要简单的点击即可实现。</p>
<p><strong>·实现步骤 </strong></p>
<p>下载php脚本<a href="http://99dev.net/wp-content/uploads/2008/09/unzip.zip">unzip.php</a></p>
<p>修改unzip.php里面的<strong>$password = “666666&#8243;;</strong>字符串，在之后的上传解压过程会用得到<span id="more-114"></span></p>
<p>将unzip.php通过FTP上传到虚拟主机，通过类似<a href="http://www.&lt;yourname&gt;.com/unzip.php">http://www.&lt;yourname&gt;.com/unzip.php</a>访问</p>
<p><a href="http://99dev.net/wp-content/uploads/2008/09/unzip.png"><img class="alignnone size-full wp-image-116" title="unzip界面" src="http://99dev.net/wp-content/uploads/2008/09/unzip.png" alt="" width="500" height="219" /></a></p>
<p>有如此图形化的界面，操作起来就很easy了</p>
<p><span style="color: #000080;">通过修改对shell command的调用，应该还可以实现对tar包的管理，琢磨中，稍后放上</span></p>
]]></content:encoded>
			<wfw:commentRss>http://99dev.net/archives/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

