The documentation is missing an important note:

The php/JAVA bridge only works on threaded http servers such as IIS, it does NOT work on http servers such as apache which fork off (sub-)processes.

The reason for this is that for each new request apache fork()'s off a new and independed copy of itself, initializes the java VM and eventually passes control over to VM until the request is finished.  If the request is  finished, the child with the java VM go to the apache pool.

That means that after a while hundreds (up to MAX-PROCESSES) of  java VM's are in the apache pool each of them eating away up to 64MB.  The machine may sooner or later crash because it ran out of memory. (If you have luck, the bridge will not run at all because apache was not statically linked to the pthreads library).

Although another php/Java bridge exists that does not have this problem (do a google search for "A new php/JAVA module"), the java binding (used by both bridges) has also problems one must be aware of. For example if one creates a Properties() object, one will receive a reference to it and may ask this reference for its values. However, if one invokes a method that returns a Properties() object, one will receive an array of values, not a reference to the Properties() object.

In short: If you want to use java from php in IIS, you can use this bridge. BUT if you want to use java from php in apache, you must use a socket approach (for an example see "A new php/JAVA module").


通过Content Negotiation ,实现根据浏览器语言跳转到相应语言的页面。


apache 的 conf中:

# 加载模块(win32)
LoadModule negotiation_module modules/mod_negotiation.so

# 指定语言的优先级别

LanguagePriority  zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-TW

# http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#forcelanguagepriority

ForceLanguagePriority Prefer Fallback

# 设置

AddHandler type-map var

# 将 type-map 类型优先

DirectoryIndex index.var index.html index.htm index.php

然后根目录下建立 index.var

URI: en/
Content-language: en
Content-type: text/html

URI: zh-CN/
Content-language: zh-CN
Content-type: text/html;charset=UTF-8

URI: zh-TW/
Content-language: tw, zh-TW
Content-type: text/html;charset=Big5



首先说明观点:bug肯定是一堆一堆的,只要不影响应用就凑合了 -0-

5月1号在s mth上逛的时候看到php-5.1.3放出来了,心想反正我目前用5的地方不多,哪天无聊在看看有哪些更新吧。结果刚才上php.net发现5.1.4出来了。乌鱼了,才3天,对php的release版本质量彻底认识了。

php 5.1.4 Released

A critical bug with $_POST array handling as well as the FastCGI sapi have been discovered in php 5.1.3. A new php release 5.1.4 is now
available to address these issues. All php users are encouraged to upgrade to this release as soon as possible.

Further details about this release can be found in the release announcement
and the full list of changes is available in the PHP 5 ChangeLog.

php 5.1.3 Released

The php development team is proud to announce the release of PHP 5.1.3.
This release combines small number of feature enhancements with a
significant amount of bug fixes and resolves a number of security
issues. Some of the key changes of php 5.1.3 include:

ps: s m t h 居然是非法的,难道是因为sm?



恩 如果这个目录存在 就 301 转向了

www.php.net …

HEAD /manual/en HTTP/1.0

Host: www.php.net

Connection: Close

HTTP/1.1 301 Moved Permanently

Date: Fri, 05 May 2006 13:40:24 GMT

Server: apache/1.3.34 (Unix) php/5.2.0-dev

Location: http://www.php.net/manual/en/

Connection: close

Content-Type: text/html; charset=iso-8859-1



 Pattern ptnScript    = Pattern.compile("<script[^<>]*>(.*?)</script>", Pattern.CASE_INSENSITIVE);

以前写php的正则不知道为啥(.*后面还要加个?) , 从来都觉得多余直接写.* , 今天吃亏了, 才知道加?是叫”非贪婪的

? 当该字符紧跟在任何一个其他限制符 (*, +, ?, {n}, {n,},
后面时,匹配模式是非贪婪的。非贪婪模式尽可能少的匹配所搜索的字符串,而默认的贪婪模式则尽可能多的匹配所搜索的字符串。例如,对于字符串 "oooo",’o+?’
将匹配单个 "o",而 ‘o+’ 将匹配所有 ‘o’。




mlb的手欠些个setConnectTimeout(60) 结果好多url取不回东西


结果发现timeout单位是milliseconds ·



2.3.9. Selecting a mysql Server type

Starting with mysql 3.23.38, the Windows distribution includes both the normal and the mysql-Max server binaries.

Up through the early releases of mysql 4.1, the servers included in Windows distributions are named like this:

Binary Description
mysqld Compiled with full debugging and automatic memory allocation checking, and InnoDB and BDB tables.
mysqld-opt Optimized binary. From version 4.0 on, InnoDB is enabled. Before 4.0, this server includes no transactional table support.
mysqld-nt Optimized binary for Windows NT, 2000, and XP with support for named pipes.
mysqld-max Optimized binary with support for InnoDB and BDB tables.
mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.

We have found that the server with the most generic name (mysqld) is the one that many users are likely to choose by default. However, that is also the server that results in the highest memory and CPU use due to the inclusion of full debugging support. The server named mysqld-opt is a better general-use server choice to make instead if you don’t need debugging support and don’t want the maximal feature set offered by the -max servers or named pipe support offered by the -nt servers.

To make it less likely that the debugging server would be chosen inadvertently, some name changes were made from mysql 4.1.2 to 4.1.4: mysqld has been renamed to mysqld-debug and mysqld-opt has been renamed to mysqld. Thus, the server that includes debugging support indicates that in its name, and the server named mysqld is an efficient default choice. The other servers still have their same names. The resulting servers are named like this:

Binary Description
mysqld-debug Compiled with full debugging and automatic memory allocation checking, and InnoDB and BDB tables.
mysqld Optimized binary with InnoDB support.
mysqld-nt Optimized binary for Windows NT, 2000, and XP with support for named pipes.
mysqld-max Optimized binary with support for InnoDB and BDB tables.
mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.

The name changes were not both instituted at the same time. If you have mysql 4.1.2 or 4.1.3, it might be that you have a server named mysqld-debug but not one named mysqld. In this case, you should have a server mysqld-opt, which you should choose as your default server unless you need maximal features, named pipes, or debugging support.

All of the preceding binaries are optimized for modern Intel processors, but should work on any Intel i386-class or higher processor.

As of mysql 4.0, all Windows servers have support for symbolic linking of database directories. Before mysql 4.0, only the debugging and Max server versions include this feature.

mysql supports TCP/IP on all Windows platforms. The mysqld-nt and mysql-max-nt servers support named pipes on Windows NT, 2000, XP, and 2003. However, the default is to use TCP/IP regardless of the platform. (Named pipes are slower than TCP/IP in many Windows configurations.)

Named pipe use is subject to these conditions:

  • Starting from mysql 3.23.50, named pipes are enabled only if you start the server with the --enable-named-pipe option. It is necessary to use this option explicitly because some users have experienced problems shutting down the mysql server when named pipes were used.

  • Named pipe connections are allowed only by the mysqld-nt or mysqld-max-nt servers, and only if the server is run on a version of Windows that supports named pipes (NT, 2000, XP, 2003).

  • These servers can be run on Windows 98 or Me, but only if TCP/IP is installed; named pipe connections cannot be used.

  • These servers can not be run on Windows 95.

Note: Most of the examples in reference manual use mysqld as the server name. If you choose to use a different server, such as mysqld-nt, make the appropriate substitutions in the commands that are shown in the examples.


28-Feb-2005 09:04
I had a similar problem to a previous poster with terrible performance. I tried changing to HTTP 1.0 but that didn’t fix it. I then removed the line:

connection: keep-alive

This fixed it. What took 13 seconds now takes 1.




1 – a标签用float
2 – 设置上层元素padding