2005-09-21

Running php 5.x on windows using tomcat 4.x or 5.x - Simple Thoughts - Java and Web Software

Running php 5.x on windows using tomcat 4.x or 5.x - Simple Thoughts - Java and Web Software " Running php 5.x on windows using tomcat 4.x or 5.x December 11th, 2004 by Angsuman What it solves: 1. Using php 5.x on Tomcat 4.x or 5.x 2. Enabling php only in one web application, instead of globally. The simplest possible configuration is described. The descriptions are terse assuming your intelligence. We will assume php will be installed in c:\ drive. Substitute with drive letter of your choice. Instructions 1. Download latest php 5.x zip file. I used http://www.php.net/get/php-5.0.2-Win32.zip/from/a/mirror . 2. Download latest Collection of PECL modules. I used http://www.php.net/get/pecl-5.0.2-Win32.zip/from/a/mirror . 3. Unzip php 5.x zip file anywhere, normally c:\php 4. Copy php.ini-dist, in c:\php, as php.ini 5. Uncomment the line (remove semi-colon at the beginning) in php.ini: ;extension=php_java.dll 6. Extract php5servlet.dll from pecl zip file to c:\php (Uncheck "Use Folder Names" in WinZip). Ensure that the file is actually present in c:\php 7. Install Tomcat and create a directory under webapps. Lets say it is named fun. 8. Create WEB-INF directory under fun 9. Create lib directory under WEB-INF 10. Create web.xml under WEB-INF with the following contents: php net.php.servlet php-formatter net.php.formatter php *.php php-formatter *.phps 11. Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c: 12. Modify both the files reflect.properties and servlet.properties to change the line library=phpsrvlt to library=php5servlet and save them. This indicates the file name of the dll file which is loaded by the Java application to serve the requests. In my version the name of the dll was php5servlet.dll. Your mileage may vary. This has no connection with the name of the jar file which can be anything. 13. Re-create the jar file 14. Copy the jar file to WEB-INF\lib directory created earlier 15. Add c:\php to your System or User Path in Windows enironment (Hint: Right-click and select Properties from My Computer) 16. Create a file test.php under fun with the following code: 17. Start Tomcat (Go to [Tomcat installation directory]\bin and type Tomcat). 18. Open your browser and go to http://localhost:8080/fun/test.php 19. Ensure that there are no errors displayed. Instead you get an informative screen with php version information and whole lot of details Let me know if this document is helpful to you. Update: Made minor revision to highlight some key elements. Update from Arundhati: Whoever is getting this error “java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path”. Please check the two properties file, whether there are any blank spaces. I was stuck in this problem for 2 days. There should be only one line, and no blank spaces. Check it now!!!. This is where the problem is lying. See more Articles on Java Software, Technology, PHP, Web, How To | | RSS 2.0 | Email this Article " http://blog.taragana.com/index.php/archive/running-php-5x-on-windows-using-tomcat-4x-or-5x/

2005-09-14

url-pattern expression

SRV.11.2 Specification of Mappings In theWeb application deployment descriptor, the following syntax is used to define mappings: • A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used for path mapping. • A string beginning with a ‘*.’ prefix is used as an extension mapping. • A string containing only the ’/’ character indicates the "default" servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null. • All other strings are used for exact matches only. 1. 以'/'开始,以'/*'结果对应的是路径匹配 /../..../* 2. 以'*.'前缀扩展名跟后面用户资源类型匹配 *.gif 3. 以url-pttern='/'表示匹配web context的根 4. 其它的url-pattern格式用于具体匹配

2005-09-06

CVSNT 连接时遇到 -1: Unknown error

用WinsockXPFix修复一下就可以了:)

Error reading from server : -1: Unknown error


This means that the client was able to connect to the server, but something disconnected it before authentication could take place.

The usual cause for this is Antivirus and/or "Personal" firewalls, which can break Handle Inheritance. To verify the culprit uninstall all such programs from your machine and try again (simply disabling them is usually not enough). If it then works re-install the software until you find which one is causing the breakage (then file a bug with the vendor concerned).

If all else fails try WinsockXPFix which restores the TCP/IP stack to a working state after spyware/AV/firewalls cause problems.

In particular the Nod32 av exhibits this behaviour. The current workaround is to disable the "IMON" service and reboot. Eset have been contacted about this problem. Until it is fixed it is recommended that Nod32 is not used on a machine running cvsnt.

Also known to break the stack is Aventail AutoSocks. No known workaround other than to uninstall it.