eygle.com   eygle.com
eygle.com  
 

« August 13, 2005 | Blog首页 | August 15, 2005 »



August 14, 2005

安装lilina news aggregator简介

作者:eygle

出处:http://blog.eygle.com

今天重新整理安装了Lilina.

Lilina是用PHP写成的在线RSS聚合阅读器,简单且强大。
你可以从http://lilina.sourceforge.net/下载最新版本,Lilina基于Magpie创建,你可以关心一下Magpie开发者的情况,Magpie Blog

Lilina的安装极其简单,下载,解包,修改权限,再修改conf.php参数文件,即可通过edit.php后台访问管理Lilina了。

关于不同字符集之间的自动转化,需要PHP的编译选项支持,需要 php4.3 + mbstring iconv支持。

我的站点安装了PHP5.0.4的最新版本。

以下链接有益参考:
Lilina:RSS聚合器构建个人门户(Write once, publish anywhere)

PHP, XML, and Character Encodings: a tale of sadness, rage, and (data-)loss

Posted by eygle at 3:50 PM | Comments (1) | TrackBack


在Redhat AD3上编译安装PHP5.0.4

作者:eygle

出处:http://blog.eygle.com

昨天心血来潮,把PHP升级了一下,结果遇到了不小的麻烦,折腾了好一会才搞定,以下是编译安装PHP5.0.4的过程:
1.下载PHP5.0.4最新版本
我们可以从官方网站下载最新版本,也可以从本站下载php5.0.4版本。
[root@eygle opt]# wget http://cn2.php.net/get/php-5.0.4.tar.gz/from/cn.php.net/mirror
--00:56:34--  http://cn2.php.net/get/php-5.0.4.tar.gz/from/cn.php.net/mirror
           => `mirror'
Resolving cn2.php.net... done.
Connecting to cn2.php.net[219.239.98.8]:80... 
[root@eygle opt]# wget http://cn.php.net/distributions/php-5.0.4.tar.gz
--00:57:37--  http://cn.php.net/distributions/php-5.0.4.tar.gz
           => `php-5.0.4.tar.gz'
Resolving cn.php.net... done.
Connecting to cn.php.net[61.129.33.155]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,839,214 [application/x-gzip]

100%[===============================================================>] 5,839,214      1.16M/s    ETA 00:00

00:57:42 (1.16 MB/s) - `php-5.0.4.tar.gz' saved [5839214/5839214]

2.解压缩
[root@eygle opt]# gzip -d php-5.0.4.tar.gz 
[root@eygle opt]# tar -xvf php-5.0.4.tar 
php-5.0.4/
php-5.0.4/ext/
php-5.0.4/ext/gd/
php-5.0.4/ext/gd/gd.c
php-5.0.4/ext/gd/gd_ctx.c
php-5.0.4/ext/gd/libgd/
......
php-5.0.4/CREDITS
php-5.0.4/README.UNIX-BUILD-SYSTEM
php-5.0.4/buildconf.bat
[root@eygle opt]# cd php-5.0.4
[root@eygle php-5.0.4]# ls
acconfig.h        ext              missing                           README.QNX                        snapshot
acconfig.h.in     EXTENSIONS       mkinstalldirs                     README.SELF-CONTAINED-EXTENSIONS  stamp-h.in
acinclude.m4      footer           netware                           README.STREAMS                    stub.c
aclocal.m4        generated_lists  NEWS                              README.SUBMITTING_PATCH           tests
build             genfiles         pear                              README.TESTING                    TODO
buildconf         header           php5.spec.in                      README.TESTING2                   TODO-5.1
buildconf.bat     INSTALL          php.gif                           README.UNIX-BUILD-SYSTEM          TODO.BUILDv5
CODING_STANDARDS  install-sh       php.ini-dist                      README.WIN32-BUILD-SYSTEM         TODO-PHP5
config.guess      LICENSE          php.ini-recommended               README.Zeus                       TSRM
config.sub        ltmain.sh        README.CVS-RULES                  regex                             win32
configure         main             README.EXTENSIONS                 run-tests-config.php              Zend
configure.in      makedist         README.EXT_SKEL                   run-tests.php
CREDITS           Makefile.frag    README.input_filter               sapi
cvsclean          Makefile.global  README.PARAMETER_PARSING_API      scripts
cvsclean.bat      makerpm          README.PHP4-TO-PHP5-THIN-CHANGES  server-tests.php


3.配置
[root@eygle php-5.0.4]# ./configure  --enable-track-vars --with-mysql --with-dom --with-zlib-dir 
--with-curl --with-iconv --with-mbstring --enable-module=so --with-apxs2
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
....
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

注意在这里第一个错误出现,这是由于--with-mysql没有指定配置路径导致的。
修改后再次运行configure成功。
[root@eygle php-5.0.4]# ./configure --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql 
--enable-track-vars --with-dom --with-zlib-dir --with-curl --with-iconv --with-mbstring
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... (cached) gcc
......
creating libtool

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/php-config
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

4.编译
[root@eygle php-5.0.4]# make
....

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

5.安装
[root@eygle php-5.0.4]# make install
Installing PHP SAPI module:       apache2handler
/opt/apache/build/instdso.sh SH_LIBTOOL='/opt/apache/build/libtool' libphp5.la /opt/apache/modules
/opt/apache/build/libtool --mode=install cp libphp5.la /opt/apache/modules/
cp .libs/libphp5.so /opt/apache/modules/libphp5.so
cp .libs/libphp5.lai /opt/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /opt/php-5.0.4/libs'
chmod 755 /opt/apache/modules/libphp5.so
[activating module `php5' in /opt/apache/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR           - already installed: 1.3.5
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] HTML_Template_IT- already installed: 1.1
[PEAR] Net_UserAgent_Detect- already installed: 2.0.1
[PEAR] XML_RPC        - already installed: 1.2.2
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
  program: phpextdist

[root@eygle php-5.0.4]# libtool --finish /opt/php-5.0.4/libs
PATH="$PATH:/sbin" ldconfig -n /opt/php-5.0.4/libs
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/php-5.0.4/libs

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
--------------------------------------------------------------------

此时安装结束。
6.进行适当链接
你可以按照习惯对PHP进行链接
[root@eygle bin]# ln -s /opt/php/bin/php /usr/bin
[root@eygle bin]# which php
/usr/bin/php
[root@eygle bin]# php -v
PHP 5.0.4 (cli) (built: Aug 14 2005 01:11:42)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies


7.重新启动Apache
以加载新的php module
[root@eygle opt]# apachectl stop
[root@eygle opt]# apachectl start

正常情况下,到这里就应该正常了,可是我却发现php不能正常使用,在error log里记录了类似如下的错误:
[root@eygle logs]# tail -f error_log 
[Sun Aug 14 03:48:17 2005] [notice] child pid 27697 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:17 2005] [notice] child pid 27705 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:22 2005] [notice] child pid 27707 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:25 2005] [notice] child pid 27683 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:30 2005] [notice] child pid 27686 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:36 2005] [notice] child pid 27685 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:37 2005] [notice] child pid 27709 exit signal Segmentation fault (11)
[Sun Aug 14 03:48:38 2005] [notice] child pid 27711 exit signal Segmentation fault (11)

在网上搜索了一下,很多人遇到这个问题,但是就是没有解答,有人说5.0.4版本太新了,有Bug用低版本的。
可是我不相信这个简单的解释。
分析一下,发现在Server端php能正常运行/执行,可是通过apache访问就不行了。
我还是怀疑问题不在php而是在apache。
在分析apache日志,发现重起时有如下一条记录:
[Sun Aug 14 03:47:50 2005] [notice] caught SIGTERM, shutting down
[Sun Aug 14 03:47:53 2005] [notice] Apache/2.0.49 (Unix) DAV/2 PHP/4.4.0 PHP/5.0.4 configured 
-- resuming normal operations

在Apache启动时记录了两个PHP版本:PHP/4.4.0 PHP/5.0.4
我怀疑这里存在问题,打开apache的配置文件(httpd.conf)看,发现存在如下两行:
LoadModule php4_module        modules/libphp4.so
LoadModule php5_module        modules/libphp5.so

Apache在这里加载php的module,由于之前装过4.4.0的php,所以这里存在两条记录。
尝试注释php4_module的记录,重起apache之后,系统恢复正常。

Posted by eygle at 2:21 PM | Comments (0) | TrackBack


郁闷的星期天清晨

作者:eygle

出处:http://blog.eygle.com

昨天晚上折腾了一下网站,一下子就到了凌晨4点,看看差不多了,还是先睡了吧。

结果6:46的时候,有朋友发短信过来问,你起床了没有。
我晕,还真是早,蒙头转向一个电话打过去,没说几句那边就Power Off了,只好继续睡觉。

结果真不幸7:53分又收到一条短信,发送号码是13366239714,内容

清纯美少女送给您全方位的性福!年龄19岁身高1.66。
在校大学生,肤白细嫩,娇柔性感,真诚为您服务!
有意男请来电话!13391576775

靠,这个郁闷,现在的骚扰短信真是无孔不入啊,以上那两个号码,如果打回去,铁定了被骗,80%可能是短信陷阱。也就是你一回电话那边就开始扣钱,而且还骗得你有苦不敢说出(这个业务创意不错,回头可以建议我公司开展)。
注意:18岁以下未成年人士,请在家长陪同下尝试。

不过话说回来,研究一下这个短信,你看看人家写的,那叫字斟句酌,简洁凝炼啊,比那啥哈发炎、学习、设论可强多了,从这个角度来说还是有值得借鉴的地方的。

再躺回床上,翻来复去都再难以入睡,看来只好承受这睡眠不足之苦了。我这个郁闷的星期天清晨。

Posted by eygle at 10:04 AM | Comments (9) | TrackBack



CopyRight © 2004-2008 eygle.com, All rights reserved.