﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-八叶草(徐怀移)-随笔分类-php</title><link>http://www.cppblog.com/byc/category/18416.html</link><description>学习资料记录</description><language>zh-cn</language><lastBuildDate>Wed, 16 May 2012 22:22:49 GMT</lastBuildDate><pubDate>Wed, 16 May 2012 22:22:49 GMT</pubDate><ttl>60</ttl><item><title>centos 6.2 手动编译 apche php 编译</title><link>http://www.cppblog.com/byc/archive/2012/01/11/163982.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Wed, 11 Jan 2012 03:14:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/01/11/163982.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/163982.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/01/11/163982.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/163982.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/163982.html</trackback:ping><description><![CDATA[<div>wget <a href="http://apache.etoak.com//httpd/httpd-2.2.21.tar.gz">http://apache.etoak.com//httpd/httpd-2.2.21.tar.gz</a><br />tar xzvf httpd-2.2.21.tar.gz<br />cd httpd-2.2.21<br />./configure --enable-so --enable-mods-shared=most<br />make<br />make install<br /><br />vi /usr/local/apache2/conf/httpd.conf #编辑配置文件<br />找到：#ServerName www.example.com:80<br />修改为：ServerName localhost:80<br />找到：DirectoryIndex index.html<br />修改为：DirectoryIndex index.html index.php<br />找到：Options Indexes FollowSymLinks<br />修改为：Options FollowSymLinks #不显示目录结构<br />增加<br />&lt;FilesMatch \.php$&gt;<br />&nbsp;&nbsp;&nbsp; SetHandler application/x-httpd-php<br />&lt;/FilesMatch&gt;<br /><br />cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd&nbsp; <br />vi /etc/init.d/httpd<br />&nbsp;在文件最前面插入下面的行，使其支持chkconfig命令：&nbsp;<br />#!/bin/sh <br /># chkconfig: 2345 85 15 <br /># description: Apache is a World Wide Web server. <br /><span style="font-size: 12pt">（注：在运行级2/3/4/5中加入服务，启动顺序85，停止顺序15）<br /></span><br />chkconfig --add httpd<br />service htpd start<br /><br /><br />yum install mysql-devel<br />yum install libpng-devel<br />yum install libjpeg-devel<br />yum install libxml2-devel<br /><br />wget <a href="http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download">http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download</a><br />tar xzvf libmcrypt-2.5.8.tar.gz<br />cd libmcrypt-2.5.8<br />./configure<br />make<br />make install<br /><br /><br />//wget <a href="http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz">http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz</a> <br />//tar xzvf libiconv-1.14.tar.gz<br />//cd libiconv-1.14&nbsp; <br />//./configure <br />//make<br />//make install<br /><br /><br /><br />wget <a href="http://museum.php.net/php5/php-5.1.6.tar.gz">http://museum.php.net/php5/php-5.1.6.tar.gz</a><br />tar xzvf php-5.1.6.tar.gz<br />cd php-5.1.6<br />./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-xlib --with-mysqli --with-jpeg-dir=/usr/lib/jpeg --with-zlib-dir=/usr/lib/zlib <br />//--with-mcrypt <br /><br />make&nbsp;<br />编译出错&nbsp; <font face="Courier New">ext/mysqli/mysqli_api.c:145: error: 'gptr' undeclared (first use in this function)</font><br /><font face="Courier New">处理 &nbsp;ext/mysqli/mysqli_api.c </font>and replace all occurrances of <code>gptr </code>with <code>char*<br /></code><br />make install<br /><br />编辑 httpd.conf 文件以调用 PHP 模块。LoadModule 表达式右边的路径必须指向 系统中的 PHP。以上的 make install 命令可能已经完成了这些，但务必要检查。 LoadModule php5_module modules/libphp5.so<br /><br />cp php.ini-dist /usr/local/php5/etc/php.ini<br /><br /><br /><br /><br /><br />
<h2>PHP扩展mcrypt编译时提示：configure: error: *** libmcrypt was not found</h2><br />需要安装libmcrypt+mhash+mcrypt 
<p>全部编译安装，安装到mcrypt的时候出现了问题</p>
<p>./config<br />checking for libmcrypt - version &gt;= 2.5.0... no<br />*** Could not run libmcrypt test program, checking why...<br />*** The test program compiled, but did not run. This usually means<br />*** that the run-time linker is not finding LIBMCRYPT or finding the wrong<br />*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your<br />*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point<br />*** to the installed location&nbsp; Also, make sure you have run ldconfig if that<br />*** is required on your system<br />***<br />*** If you have an old version installed, it is best to remove it, although<br />*** you may also be able to get things to work by modifying LD_LIBRARY_PATH<br />***<br />configure: error: *** libmcrypt was not found</p>
<p>解决方法如下：运行 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH</p>
<p>然后make ； make install</p>
<p>完成<br /></p><br /></div><img src ="http://www.cppblog.com/byc/aggbug/163982.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-01-11 11:14 <a href="http://www.cppblog.com/byc/archive/2012/01/11/163982.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>centos5 php5.1.6 升级到 php5.2.17</title><link>http://www.cppblog.com/byc/archive/2011/12/29/163068.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Thu, 29 Dec 2011 01:54:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/12/29/163068.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/163068.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/12/29/163068.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/163068.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/163068.html</trackback:ping><description><![CDATA[root@linuxbox ~]# wget <a href="http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-2.ius.el5.noarch.rpm">http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/</a><a href="http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-8.ius.el5.noarch.rpm">ius-release-1.0-8.ius.el5.noarch.rpm</a><br /><span id="line-3" class="anchor"></span>root@linuxbox ~]# wget <a href="http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/--/epel-release-1-1.ius.el5.noarch.rpm">http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/<u><font color="#0066cc">i386</font></u>/</a><a href="http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm">epel-release-5-4.noarch.rpm</a><br />root@linuxbox ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm<br />$ sudo yum install yum-plugin-replace<br />[root@linuxbox ~]# yum replace php --replace-with php52<br /><br />来源&nbsp; <a href="http://wiki.iuscommunity.org/Doc/ClientUsageGuide">http://wiki.iuscommunity.org/Doc/ClientUsageGuide</a> <br /><br /><br />任一种办法<br /><span style="color: #000000"><font face="Courier New"><span style="color: #0000bb"><span>
<p>CentOS 5.x 系统下使用yum 升级php到5.2.x 最方便方法</p>
<p>先将以下地址导入。</p>
<p># <code>rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</code></p>
<p># <code>vi /etc/yum.repos.d/CentOS-Base.repo</code> 增加下面信息</p>
<p><code>[utterramblings]<br />name=Jason's Utter Ramblings Repo<br />baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/<br />enabled=1<br />gpgcheck=1<br />gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</code></p>
<p>执行命令，自动升级。<br /><code><br />yum update php -y<br />yum install libmcrypt -y</code></p></span></span></font></span><img src ="http://www.cppblog.com/byc/aggbug/163068.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-12-29 09:54 <a href="http://www.cppblog.com/byc/archive/2011/12/29/163068.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>php xdebug</title><link>http://www.cppblog.com/byc/archive/2011/12/25/162770.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Sun, 25 Dec 2011 04:07:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/12/25/162770.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/162770.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/12/25/162770.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/162770.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/162770.html</trackback:ping><description><![CDATA[centos 5.7<br />
<p>yum install php-devel<br />wget&nbsp;<a href="http://www.xdebug.org/files/xdebug-2.0.3.tgz">http://www.xdebug.org/files/xdebug-2.0.3.tgz</a></p>tar zxvf &nbsp;xdebug-2.0.3.tgz<br />cd&nbsp;xdebug-2.0.3<br />phpize<br />./configure --enable-xdebug --with-php-config=/usr/bin/php-config<br />make &amp;&amp; make install<br /><br /><br />[Xdebug]<br />zend_extension=/usr/lib/php/modules/xdebug.so<br />xdebug.default_enable=On<br />xdebug.auto_trace=On<br />xdebug.collect_params=On<br />xdebug.collect_return=On<br />xdebug.profiler_enable=On<br />xdebug.remote_autostart=On<br />xdebug.remote_enable=On<br />xdebug.remote_host=192.168.1.*<br />xdebug.remote_port=9000<br />xdebug.remote_handler=dbgp<br /><br /><br />问题:<br />autoconf 版本非2.61 <br /># wget <a href="http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz">http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz</a><br style="line-height: 22px" /># tar -zvxf autoconf-2.61.tar.gz<br style="line-height: 22px" /># cd autoconf-2.61/<br style="line-height: 22px" /># ./configure &amp;&amp; make &amp;&amp; make install<br style="line-height: 22px" /><br /><br /><img src ="http://www.cppblog.com/byc/aggbug/162770.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-12-25 12:07 <a href="http://www.cppblog.com/byc/archive/2011/12/25/162770.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>