Results tagged “php” from WHO IS 2HEI?

 windows下搭建apache+php+mysql环境很简单,不过也总会有一些问题

以下是我搭建过程中的遇到的问题:
Windows + apache2.2.11 + php5.2.9 + mysql5,每个软件安全都很简单,只是apache启动后半分钟就自动关闭。
具体日志如下:
[Mon May 25 23:34:13 2009] [notice] Apache/2.2.11 (Win32) PHP/5.2.9-1 configured -- resuming normal operations
[Mon May 25 23:34:13 2009] [notice] Server built: Dec 10 2008 00:10:06
[Mon May 25 23:34:13 2009] [notice] Parent: Created child process 2860
[Mon May 25 23:34:14 2009] [notice] Child 2860: Child process is running
[Mon May 25 23:34:14 2009] [notice] Child 2860: Acquired the start mutex.
[Mon May 25 23:34:14 2009] [notice] Child 2860: Starting 64 worker threads.
[Mon May 25 23:34:14 2009] [notice] Child 2860: Starting thread to listen on port 8008.
[Mon May 25 23:35:01 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon May 25 23:35:01 2009] [notice] Child 2860: Exit event signaled. Child process is ending.
[Mon May 25 23:35:02 2009] [notice] Child 2860: Released the start mutex
[Mon May 25 23:35:03 2009] [notice] Child 2860: All worker threads have exited.
[Mon May 25 23:35:03 2009] [notice] Child 2860: Child process is exiting
[Mon May 25 23:35:03 2009] [notice] Parent: Child process exited successfully.

试过了网上的所有办法:
httpd.conf上增加
MaxRequestsPerChild 0
EnableSendfile off

TCP-IP--高级--wins--启用LMHOSTS查询,禁用TCP/IP上的NetBios
关闭防火墙
都没有彻底解决。

甚至追溯到apache的bug,如下:
http://apache2triad.net/forums/archive/o_t__t_4162__setsockoptso-update-accept-context-failed.html
http://apache2triad.net/forums/viewtopic.php?t=55

郁闷中。。。即便是Linux下也没有如此费事啊!
后来想想http服务器又不只有apache,尝试一下其他的更高效、性能更好的服务器吧,nginx和lighttpd。
windows版lighttpd下载地址
具体配置看lighttpd的文档吧
http://en.wlmp-project.net/downloads.php
http://trac.lighttpd.net/trac/wiki/Docs

只是lighttpd在windows下启动的时候会有一个dos的窗口,大家可以找找RunHiddenConsole.exe这个东东,它可以隐藏dos窗口哩!
| | Comments (0) | TrackBacks (0)
I install php5.2.6 with apache2.x, I meet this error!

Installing PHP SAPI module:       apache2handler
/home/apache2/build/instdso.sh SH_LIBTOOL='/home/apache2/build/libtool' libphp5.la /home/apache2/modules
/home/apache2/build/libtool --mode=install cp libphp5.la /home/apache2/modules/
cp .libs/libphp5.lai /home/apache2/modules/libphp5.la
cp .libs/libphp5.a /home/apache2/modules/libphp5.a
chmod 644 /home/apache2/modules/libphp5.a
ranlib /home/apache2/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish /home/yujingtao/soft/php-5.2.6/libs'
Warning!  dlname not found in /home/apache2/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /home/apache2/modules/libphp5.so
chmod: cannot access `/home/apache2/modules/libphp5.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1

my configure script is below:
./configure --with-apxs2=/home/apache2/bin/apxs --with-mysql-sock=/tmp/mysql.sock LDFLAGS='-L/usr/lib64'

google for a along time , still have this error, Can anybody help me??
| | Comments (0) | TrackBacks (0)

使用php判断用户访问的浏览器类别
判断如果得不到浏览器类型或者得到的浏览器类型为手机类型的话,页面跳转到手机可以访问的wap站点。


//add redirect to wap
$browser = $_SERVER['HTTP_USER_AGENT'];

if(empty($browser)||$browser==""||strpos(strtolower($browser),"mot")||strpos(strtolower($browser),"norkia")||strpos(strtolower($browser),"sonyericsson")){
header("location:http://2hei.net");
}


if(strpos(strtolower($browser),"msie")||strpos(strtolower($browser),"opera")||strpos(strtolower($browser),"firefox")){
  echo "www-access";
  echo strlen($browser);
}

注意:使用header进行页面跳转时,前面不要有任何输出。


获得其他访问用户信息。

“HTTP_USER_AGENT”
“REMOTE_ADDR”
“REMOTE_PORT”

| | Comments (0) | TrackBacks (0)

找了一下企业网站的php程序,开源的很少,让我满意的就更少了。

找来找去,找到了深喉咙http://www.deepthroat.com.cn


网上宣传的确实不错,而且有个Deepthroat [Version 2.3 ] Php版本(开源版本) 。
果然是傻瓜式安装啊,都给打成了集成包。不过我的系统都是Linux的,所以还是手工安装了一下。
感觉开源的版本的模板少的可怜,好看的模板都是商业版本的。

安装了一下商用版本,提示让我导入授权文件,汗!既然收费了,那就不用了。

不过安装商用版3.5时,也是颇费周折,遇到了 date_default_timezone_set()的问题。

打开index.php,提示

Fatal error: Call to undefined function: date_default_timezone_set() in /home/www/deep/index.php on line 5

Google了一下,原来是我的php版本的问题,原来的版本是php5.0.5,于是把php升级到5.2就可以了。

| | Comments (0) | TrackBacks (0)

标签