php¿¡¼ JAVA class »ç¿ëÀ§ÇÑ ¿¬µ¿ (FreeBSD) | ÀÛ¼ºÀÏ : 2005/10/30 01:53 |
Á¶È¸¼ö : 13715 |
Á¦ ¸ñ : php¿¡¼ JAVA class »ç¿ëÀ§ÇÑ php/java ¿¬µ¿ (FreeBSD) ±Û¾´ÀÌ : ÁÁÀºÁøÈ£(truefeel, http://coffeenix.net/ ) ÀÛ¼ºÀÏ : 2005.7.12(È)~14(¸ñ) Á¤¸®ÀÏ : 2005.10.28(±Ý) php¿¡ JAVA class¸¦ È£ÃâÇÏ¿© »ç¿ëÇϱâ À§ÇÑ php ¼³Á¤¿¡ ´ëÇØ ¾Ë¾Æº»´Ù. JDK³ª APM ¼³Ä¡ °úÁ¤Àº ¹Ì¸® ¾Ë°Å¶ó »ý°¢ÇÏ°í ¿¬µ¿°ú °ü·ÃµÈ ºÎºÐ À§ÁÖ·Î ¼³¸íÇÒ °ÍÀÌ´Ù. 1. JDK ¼³Ä¡ FreeBSD¿ëÀ¸·Î ÆÐÄ¡µÈ JDK ¶Ç´Â linux-sun-jdk14 ¸¦ ¼³Ä¡ÇÑ´Ù. makeÇÒ ¶§ Ãâ·ÂµÇ´Â URL¿¡¼ JDK´Â Á÷Á¢ ¹Þ¾Æ /usr/ports/distfiles ¿¡ º¹»çÇØµÖ¾ß ÇÏ´Â °ÍÀº ¾Ë°ÚÁÒ?
ÀÌÁ¦ ȯ°æº¯¼ö ¼³Á¤À» ÇÑ´Ù. setenv JAVAHOME /usr/local/java setenv LD_LIBRARY_PATH /usr/local/lib:/usr/lib:/usr/local/lib/php: <-- ´ÙÀ½ÁÙ±îÁö ÇÑÁÙ·Î /usr/local/lib/php/20020429:$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/server 2. apache À缳ġ apache°¡ ¼³Ä¡µÇ¾î ÀÖ´Ù¸é pthread »ç¿ëÇÏ¿© ÀçÄÄÆÄÀÏÇÑ´Ù. pthread¸¦ »ç¿ëÇÏÁö ¾Ê°í ÄÄÆÄÀÏÀ» Çϸé php¿¡¼ java class »ç¿ë½Ã ¿¡·¯°¡ ¹ß»ýÇÒ °ÍÀÌ´Ù. /usr/ports/www/apache13/Makefile ÆÄÀÏ¿¡¼ 130¿©¹ø°ÁÙ Á¤µµ¿¡¼ ´ÙÀ½À» ¼öÁ¤ÇÑ´Ù.
¶ÇÇÑ ´ëÇü »çÀÌÆ®ÀÏ °æ¿ì httpd.conf¿¡¼ MaxClients¸¦ 512 ÀÌ»óÀ¸·Î ¼³Á¤ÇÒ ¼ö ÀÖµµ·Ï HARD_SERVER_LIMIT °ªÀ» 1024³ª 2048·Î ´Ã¸°´Ù.
ÀÌÁ¦ ÄÄÆÄÀÏÇÏÀÚ.
3. php ¼³Ä¡ /usr/port/lang/php4/Makefile ÀÇ CONFIGURE_ARGS= Áß°£¿¡ --with-java= ¿É¼ÇÀ» »ðÀÔÇÑ´Ù.
³ª¸ÓÁö´Â apache¿¡ php ¿¬µ¿Çϱâ À§ÇÑ ÇüÅ·Π¼³Ä¡¸¦ ÇÏ¸é µÇ¸ç, ¼³Ä¡ ÈÄ¿¡´Â ´ÙÀ½ ÀÛ¾÷ÀÌ ¹Ýµå½Ã ÇÊ¿äÇÏ´Ù.
±×¸®°í, /usr/local/etc/php/extentions.ini ¿¡ extension=java.so Ãß°¡. /usr/local/etc/php.ini¿¡´Â [java] section ¼³Á¤ÀÌ ÇÊ¿äÇÏ´Ù. java.class.path= ¿¡´Â ÇÊ¿äÇÑ class µð·ºÅ丮³ª jar ÆÄÀÏ full°æ·Î¸¦ ÁöÁ¤ÇÏ¸é µÈ´Ù.
4. Å×½ºÆ® * javaver.html
À¥ºê¶ó¿ìÀú¿¡ ´ÙÀ½°ú °°ÀÌ °á°ú¸¦ ¾ò¾ú´Ù¸é ¼º°øÀûÀ¸·Î ¼³Ä¡µÇ¾ú´Ù.
5. ¹®Á¦ ÇØ°á 1) Fatal error: Unable to locate CreateJavaVM function in /home/truefeel/public_html/javaver.html on line 3 ¿¡·¯ ¹ß»ý -> php.ini ÀÇ [java] ºÎºÐ¿¡ java.library¸¦ ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù. (/usr/local/java ´Â JDKÀÇ È¨ °æ·ÎÀÓ)
2) Fatal error: Cannot instantiate non-existent class: java in /home/truefeel/public_html/javaver.html on line 3 -> extensions.ini ¿¡ extension=java.so Ãß°¡ 3) php ~truefeel/public_html/javaver.html ½ÇÇà½Ã /usr/libexec/ld-elf.so.1: /usr/local/java/jre/lib/i386/server/libjvm.so: Undefined symbol "pthread_main_np" ¶Ç´Â apacheÀÇ error.log¿¡ À§ÀÇ ¸Þ½ÃÁö°¡ ³²À» ¶§ -> apache¸¦ pthread »ç¿ëÇؼ ÀçÄÄÆÄÀÏÇÑ´Ù. 4) php ½ÇÇà½Ã PHP Warning: Function registration failed - duplicate name - java_last_exception_get in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - java_last_exception_clear in Unknown on line 0 PHP Warning: java: Unable to register functions, unable to load in Unknown on line 0 -> extensions.ini ¿¡ extension=java.so ÀÌ 2ÁÙ ÀÌ»óÀÏ ¶§ ¹ß»ý 5) php ½ÇÇà½Ã ¾Æ¹« ¿¡·¯¸Þ½ÃÁöµµ ¾ø°í apache error log¿¡µµ ¾Æ¹«°Íµµ ¾øÀ¸³ª °á°ú°¡ ¾È³ª¿Ã ¶§ -> ȯ°æº¯¼ö LD_LIBRARY_PATH ¸¦ ¼ÂÆÃÇß´ÂÁö È®ÀÎÇغÁ¶ó. 6. Âü°í ÀÚ·á * PHP / Java Integration (¿¬µ¿Å×½ºÆ®¿ë ¿¹Á¦¿Í ¼³Ä¡ ¹æ¹ý µî¿¡ ´ëÇÑ ¼³¸í) http://www.php.net/java * java & php4 + apache 1.3.x http://lists.freebsd.org/pipermail/freebsd-questions/2003-December/029894.html * FreeBSD+PHP+Java(jdk1.4.2) http://blog.devep.net/adex/2005/03/11/1110477642312.html * Re: FreeBSD + ext/java http://aspn.activestate.com/ASPN/Mail/Message/php-install/1050662
|
Ä¿ÇǴнº, ½Ã½ºÅÛ ¿£Áö´Ï¾îÀÇ ½°ÅÍ / URL : http://coffeenix.net/board_view.php?bd_code=1231 |