¸®´ª½º °ü·Ã °Á¶õ |
---|
Á¦¸ñ | PHP/FI #1 1999/01/02 (10:39) |
À̸§ | ±èÈ¿¿ø |
¹øÈ£ | 72 |
Á¶È¸ | 443 |
º»¹® |
¡º¸®´ª½º Çдç-¸®´ª½º °Á / ¿¬Àç (go LINUX)¡» 427¹ø Á¦ ¸ñ:[°ÁÂ01] PHP/FI ¸¦ ÀÌ¿ëÇÑ ÀÎÆ®¶ó³Ý±¸Ãà ¿Ã¸°ÀÌ:kingcrab(¹ÚÀçÈ ) 97/03/18 19:04 ÀÐÀ½:2244 °ü·ÃÀÚ·á ¾øÀ½ ----------------------------------------------------------------------------- ------------------------------------------------------------------------------ 0. ¼ ¹® ------------------------------------------------------------------------------ À¥¼¹ö¸¦ ±¸ÃàÇÏ´Ùº¸¸é ÇÊ¿äÇÑ °ÍÀÌ »ó´çÈ÷ ¸¹´Ù´Â °ÍÀ» °¡²û ´À³¢°Ô µÈ´Ù. ÆÄÀÏ ¾÷·Îµå±â´ÉÀ̶óµçÁö, ºñºñ¿¡½º¿¡¼¿Í °°Àº °Ô½ÃÆÇ ±â´ÉÀ̶óµçÁö, »ç¿ëÀÚ µî·Ï°ú °°Àº ¿©·¯°¡Áö ±â´ÉµéÀÌ »ç½Ç ÇÊ¿äÇÒ °æ¿ì°¡ ¸¹´Ù. ¸¹Àº °æ¿ì¿¡ Á÷Á¢ ÇÁ·Î±×·¥À» Â¥¼ »ç¿ëÇϰųª ±âÁ¸¿¡ Â¥¿©Áø ¼Ò½º¸¦ ±×´ë·Î °¡Á®¿Í¼ »ç¿ëÇÏ°Ô µÇ´Âµ¥ ¿©±â¼ µµ Rasmus Lerdorf<rasmus@lerdorf.on.ca> ¾¾°¡ ¸¸µç PHP/FI ¶ó´Â ÅøÀ» °¡Áö°í ÀÌ ·¯ÇÑ ±â´ÉµéÀ» °¡Áø À¥¼¹ö¸¦ ±¸ÃàÇغ¸°íÀÚ ÇÑ´Ù. (PHP/FI - Personal Home Page Construction Kit / Form Interpreter) ¸ÕÀú PHP/FI ¸¦ ÀÌ¿ëÇÏ¿© À¥¼¹ö¸¦ ±¸ÃàÇϱâ À§Çؼ ÇϳªÀÇ µ¥ÀÌŸº£À̽º°¡ ÀÖ¾î ¾ßÇÏ°í, ÀûÀýÇÑ À¥¼¹ö ÇÁ·Î±×·¥ÀÌ ÇÊ¿äÇÏ°í, ´ç¿¬È÷ PHP/FI ÆÐÅ°Áö°¡ ÇÊ¿äÇÏ´Ù. ±×¿Ü¿¡ ¸î°¡Áö ÄÄÆÄÀÏÇϴµ¥ ÇÊ¿äÇÑ ÆÐÅ°ÁöµéÀÌ ÀÖ´Ù. ------------------------------------------------------------------------------ I. Installation ------------------------------------------------------------------------------ ¿©±â¼´Â µ¥ÀÌŸº£À̽º·Î mSQL À», À¥¼¹ö·Î´Â Apache ¸¦ ÀÌ¿ëÇϱâ·Î ÇÏ°Ú´Ù. ù¹ø ° Àå¿¡¼´Â À§¿¡¼ ¾ð±ÞÇÑ ÆÐÅ°ÁöµéÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ´Ù·ç±â·Î ÇÑ´Ù. 1. mSQL ¼³Ä¡ ------------ msql-2.0-B4.tar.gz ÆÄÀÏÀ» ´Ù¿î·Îµå ¹Þ¾Æ¼ ÀÓÀÇÀÇ µð·ºÅ͸®¿¡´Ù ¾ÐÃàÀ» Ç®¾î³õ´Â ´Ù. »ý¼ºµÈ µð·ºÅ͸®·Î µé¾î°¡¼ ¾Æ·¡¿Í °°ÀÌ ÇÑ´Ù. hackers:~/msql-2.0-B4# make target ±×·¯¸é ÇöÀç ½Ã½ºÅÛ¿¡ °üÇÑ µð·ºÅ͸®¸¦ »ý¼ºÇÏ°í ±× ¾Æ·¡¿¡ ¼Ò½ºµéÀ» ¸µÅ©½ÃŲ´Ù. targets µð·ºÅ͸®¿¡ ½Ã½ºÅÛ¿¡ ÇØ´çÇÏ´Â µð·ºÅ͸®·Î À̵¿ÇÑ ´ÙÀ½ setup À» ½ÇÇà½ÃŲ ´Ù. hackers:~/msql-2.0-B4/targets/Linux-2.0.29-i586# ./setup hackers:~/msql-2.0-B4/targets/Linux-2.0.29-i586# make all hackers:~/msql-2.0-B4/targets/Linux-2.0.29-i586# make install À§¿Í °°ÀÌ ÇÏ¸é ¹«¸®¾øÀÌ ÄÄÆÄÀÏ°ú ¼³Ä¡°¡ ¿Ï·áµÈ´Ù. ¼³Ä¡´Â /usr/local/Hughes/ µð·ºÅ͸®ÇÏ¿¡ ±âº»ÀûÀ¸·Î ¼³Ä¡µÈ´Ù. ¼³Ä¡µÈ µð·ºÅ͸®·Î À̵¿Çؼ msql.conf ÆÄÀÏ¿¡¼ mSQL_User ¿Í Admin_User µîÀ» È®ÀÎÇÏ°í ´ÙÀ½°ú °°ÀÌ mSQL »ç¿ëÀÚ¸¦ ¸¸µç´Ù. hackers:/usr/local/Hughes# adduser Adding a new user. The username should not exceed 8 characters in length, or you may run into problems later. Enter login name for new account (^C to quit): msql Editing information for new user [msql] Full Name: mSQL User GID [100]: Group 'users', GID 100 First unused uid is 502 UID [502]: Home Directory [/home/msql]: /usr/local/Hughes Shell [/bin/bash]: Password [msql]: Information for new user [msql]: Home directory: [/usr/local/Hughes] Shell: [/bin/bash] uid: [502] gid: [100] Is this correct? [y/N]: y Adding login [msql] and making directory [/usr/local/Hughes] ÀϹÝÀûÀ¸·Î mSQL »ç¿ëÀÚ´Â msql ·Î ÇÏ°í, Admin Àº root °¡ ÇÑ´Ù. Admin Àº º¸Åë µ¥ ÀÌÅͺ£À̽º¸¦ »ý¼º½ÃŲ´Ù´ø°¡, ¼¹ö¸¦ ¼Ë´Ù¿î½ÃÅ°´ÂµîÀÇ ÀÛ¾÷À» ÇÑ´Ù. /usr/local/Hughes µð·ºÅ͸®·Î À̵¿ÇÏ¿© ÇÏÀ§µð·ºÅ͸®¿Í ÆÄÀϵéÀÇ Æ۹̼ÇÀ» Á¶Á¤ÇØÁØ ´Ù. hackers:/usr/local/Hughes# chown -R msql * hackers:/usr/local/Hughes# chgrp -R users * msql ·Î ·Î±äÇؼ msql.acl.sample ÆÄÀÏÀ» msql.acl ·Î º¹»çÇÏ°í msql.acl À» ÀûÀýÈ÷ ¼öÁ¤ÇØÁØ´Ù. hackers:/usr/local/Hughes# su - msql hackers:~$ cp msql.acl.sample msql.acl -[msql.acl]------------------------------------------------------------------- # # Access control for mSQL # # Entries are of the form # database=minerva read=* write=* access=local,remote option=rfc931 ------------------------------------------------------------------------------ À§¿Í °°À¸¸é µ¥ÀÌŸº£À̽º À̸§Àº minerva °í, ¸ðµÎ ÀÐ°í ¾µ ¼ö ÀÖÀ¸¸ç, ·ÎÄÃÀ̳ª ¸® ¸ðÆ®¿¡¼µµ ¾ï¼¼½º°¡ °¡´ÉÇÏ´Ù´Â ¶æÀÌ´Ù. ´Ù¸¥ µ¥ÀÌŸº£À̽º´Â ´Ù¸¥ ¾ï¼¼½º Á¦¾î¸¦ ÇÒ ¼öµµ ÀÖ´Ù. WWW ÀÎÅÍÆäÀ̽º ÆÐÅ°Áö¸¦ »ç¿ëÇÏ·Á¸é ¸ÕÀú mSQL ¼¹ö¸¦ ½ÃÀÛ½ÃÅ°°í, misc/setup_www ¸¦ ½ÇÇà½ÃŲ´Ù. µ¥ÀÌŸº£À̽º¸¦ »ý¼º½ÃÅ°±â À§ÇØ setup_www ´Â Admin User(root) ·Î ½ÇÇà½ÃÄÑ¾ß ÇÑ´Ù. hackers:~$ msql2d & hackers:~$ misc/setup_www hackers:~$ su Password: hackers:/usr/local/Hughes# misc/setup_www Creating the empty databases ...Database "w3-msql" created. Database "bookmarks" created. W3-mSQL Setup ------------- Connecting to the mSQL server ... connected. Creating the namespace table ... done. Creating the areas table ... done. Creating the access control table ... done. Creating the access control table index ... done. Creating the users table ... done. Creating the users table index ... done. Creating the namespace perms table ... done. Creating the namespace perms table index ... done. Creating the group_members table ... done. Creating the group_members table index ... done. Creating the groups table ... done. Creating the groups table index ... done. Creating the group_admin table ... done. Creating the group_admin table index ... done. Creating the W3-auth administrative namespace ... done. Adding a "super user" to the w3-msql auth tables Username : webmaster Full name : Web Master Password : ******** Done. Setup of W3-mSQL is complete Setting up the demostration application database ------------------------------------------------ Swapping to the bookmarks database ... done. Creating the bookmarks table ... done. Inserting sample data ... done. Setup complete. À§¿Í °°ÀÌ ÀÛ¾÷ÇÑ µÚ¿¡ Á¦´ë·Î µÇ¾ú³ª ´ÙÀ½°ú °°ÀÌ È®ÀÎÇÑ´Ù. hackers:/usr/local/Hughes# exit exit hackers:~$ relshow +-----------------+ | Databases | +-----------------+ | w3-msql | | bookmarks | +-----------------+ 2. PHP/FI ¼³Ä¡ -------------- 2.1 PHP/FI CGI ÄÄÆÄÀÏ PHP/FI ¸¦ ¼³Ä¡Çϱâ À§Çؼ´Â gdbm ÆÐÅ°Áö°¡ ÀÖ¾î¾ßÇÑ´Ù. µÉ ¼ö ÀÖÀ¸¸é ÃÖ½ÅÀÇ ¹öÁ¯ À» ±¸Çؼ ¹Ì¸® ¼³Ä¡Çسõ±â ¹Ù¶õ´Ù. php-2.0b10.tar.gz ¸¦ ÀÓÀÇÀÇ µð·ºÅ͸®¿¡´Ù ¾ÐÃà À» Ç®¾î³õ°í À̵¿Çؼ ´ÙÀ½°ú °°ÀÌ ÀÛ¾÷À» ÁøÇàÇÑ´Ù. hackers:~/php-2.0b10# ./install PHP/FI Installation [´ÙÀ½ÀÇ Áú¹®¿¡ ÇØ´çÇÏ´Â ÀûÀýÇÑ ´äÀ» ÇÏ°í, À߸𸦶§¿¡´Â ±×³É ¿£ÅÍÅ°¸¦ ´·¯¼ ±â º»°ªÀ» ¼³Á¤ÇÑ´Ù.] Do you have mSQL installed on this system? [yN] y Top of your mSQL install tree? [/usr/local/Minerva] /usr/local/Hughes [mSQL À» ¼³Ä¡ÇÏ¿´À¸¹Ç·Î Yes. ¼³Ä¡µÈ µð·ºÅ͸®°¡ ´Ù¸¦°æ¿ì À§¿Í°°ÀÌ ¸Â°Ô Àû¾îÁØ ´Ù.] Do you have Sybase libraries installed on this system [yN] Do you have Postgres95 installed in this system? [yN] Do you have mysql installed on this system? [yN] Do you have Solid installed in this system? [yN] [PHP/FI ¸¦ Apache À¥¼¹öÀÇ ¸ðµâ·Î ÄÄÆÄÀÏÇÒ °ÍÀΰ¡¿¡ ´ëÇÑ Áú¹®ÀÌ´Ù. µÎ°¡Áö ¹æ¹ý ÀÌ Àִµ¥ Çϳª´Â php.cgi ·Î ¸¸µé¾î PHP/FI ½ºÅ©¸³Æ®°¡ µé¾î°¡ ÀÖ´Â ÆäÀÌÁöµéÀ» ¸ð µÎ ÀÌ ½ÇÇàÆÄÀÏÀ» ÅëÇØ Apache ·Î Àü´ÞµÈ´Ù. ¶ÇÇÑ°¡Áö´Â Apache ÀÇ ¸ðµâ·Î ¸¸µé¾î httpd ¿¡ Æ÷ÇԵȴÙ.] Would you like to compile PHP/FI as an Apache module? [yN] Do you want to dynamically link utility libraries? [Yn] Would you like to compile PHP/FI with FastCGI support? [yN] Would you like to include access control support? [yN] y You need to choose an access control directory. This directory must be readable and writable by the user id under which your http server runs. Access control directory? [/usr/local/etc/httpd/cgi-data] Would you like to include page logging support? [Yn] [Log ÆÄÀϵéÀ» dbm, ȤÀº mSQL Æ÷¸ËÁß ¾î´À Æ÷¸ËÀ¸·Î ÀúÀåÇϰڳĴ Áú¹®ÀÌ´Ù. ¿©±â¼ mSQL À» ¼³Ä¡ÇÏ¿´À¸¹Ç·Î 'm' À» ÀÔ·ÂÇÑ´Ù.] Would you like to store your log files in dbm or mSQL format? [dm] m mSQL Logging enabled. Note that you will need to create a phpfi database and appropriate tables for each user id for which logging should be done. See the documentation doc/doc.html for details. Would you like to include file upload support? [Yn] Would you like to build an ELF shared library? [yN] Additional directories to search for .h files []: Additional directories to search for library files []: : : *IMPORTANT* If you are compiling the Apache module, make sure you set Apache's regexp setting accordingly in the Configuration file. ie. WANTHSREGEX=no if you answer No here. [Á¤±ÔÇ¥Çö½Ä ¶óÀ̺귯¸®¿¡ °üÇÑ °ÍÀε¥ ¿©±â¼´Â ¹øµé·Î Á¦°øµÇ´Â ¶óÀ̺귯¸®¸¦ »ç¿ë ÇÑ´Ù. Apache ¼¹ö¸¦ ÄÄÆÄÀÏÇÒ ¶§ Configuration ÆÄÀϳ»¿¡¼ WANTHSREGEX ¸¦ yes ·Î ¼ÂÆÃÇÑ´Ù.] Would you like the bundled regex library? [yN] y Using the included Posix regular expression library hackers:~/php-2.0b10# cd src; make ÄÄÆÄÀÏÀ» ¿Ï·áÇÏ°í³ª¸é, src µð·ºÅ͸®¿¡ php.cgi ¶ó´Â ½ÇÇàÆÄÀÏÀÌ »ý¼ºµÈ´Ù. ÀÌ ½ÇÇà ÆÄÀÏÀÌ Á¦´ë·Î ÀÛµ¿ÇÏ´ÂÁö »ìÆ캸ÀÚ. Å×½ºÆ®¸¦ Çϱ⿡ ¾Õ¼ mSQL Å×½ºÆ®¸¦ À§ÇØ ´ÙÀ½°ú °°ÀÌ Å×½ºÆ®¿ë µ¥ÀÌŸº£À̽º¸¦ ¸¸ µé¾îµÖ¾ßÇÑ´Ù. hackers:/usr/local/Hughes/sql# msqladmin create test Database "test" created. hackers:/usr/local/Hughes/sql# su - msql hackers:~$ msql test < test.sql test.sql Àº php-2.0b10/test/msql/README ÆÄÀÏÀ» ±×´ë·Î º¹»çÇؼ ¾²¸é µÈ´Ù. hackers:~/php-2.0b10/src# make test cd ../test; \ ./testmenu PHP/FI Regression Test Menu 1) Basic Tests 2) Language Construct Tests 3) Regular Expression Tests 4) Built-in Function Tests 5) DBM Tests 6) mSQL Tests 7) Postgres95 Tests 0) Run All Tests q) Quit ? 0 Trivial "Hello World" test ...PASS Simple POST Method test ...PASS GET and POST Method combined ...PASS Two variables in POST data ...PASS Three variables in POST data ...PASS Add 3 variables together and print result ...PASS Multiply 3 variables and print result ...PASS Divide 3 variables and print result ...PASS Subtract 3 variables and print result ...PASS Testing | and & operators ...PASS Simple If condition test ...PASS Simple While Loop Test ...PASS Simple Switch Test ...PASS Simple If/Else Test ...PASS Simple If/ElseIf/Else Test ...PASS Nested If/ElseIf/Else Test ...PASS Function call with global and static variables ...PASS Testing recursive function ...PASS Testing function parameter passing ...PASS Testing function parameter passing with a return value ...PASS Testing nested functions ...PASS Testing stack after early function return ...PASS Testing eval function ...PASS Testing eval function inside user-defined function ...PASS Testing include ...PASS Testing user-defined function in included file ...PASS Testing user-defined function falling out of an If into another..PASS RegReplace test 1 ...PASS RegReplace test 2 ...PASS RegReplace sigle-quote test ...PASS RegMatch Test ...PASS Test Regular expression register support in RegMatch ...PASS Test ereg_replace of start-of-line ...PASS Test empty result buffer in reg_replace ...PASS Strlen() function test ...PASS DBM File Creation Test ...PASS DBM Insert/Fetch Test ...PASS DBM Insert/Replace/Fetch Test ...PASS DBM Multiple Insert/Fetch Test ...PASS DBM FirstKey/NextKey Loop Test With 5 Items ...PASS DBM FirstKey/NextKey with 2 deletes ...PASS mSQL insert/query test (See test/msql/README to set up test) ...PASS mSQL Multiple insert/query test ...PASS mSQL MAGIC_QUOTE Test (will fail if MAGIC_QUOTES is off) ...PASS PG95 Check connection and info funcs (see test/pg95/README) ...FAIL PG95 Basic execution and selection ...FAIL PG95 MAGIC_QUOTE Test (will fail if MAGIC_QUOTES is off) ...FAIL PG95 Inserts, selections and results, oh my ...FAIL PG95 Field info tests ...FAIL 2.2 PHP/FI Apache Web Server ¸ðµâ ÄÄÆÄÀÏ PHP/FI ¸¦ Apache ÀÇ ¸ðµâ·Î ÄÄÆÄÀÏÇؼ ¾²´Â ÀÌÀ¯´Â ¸î°¡Áö°¡ ÀÖ´Ù. ¸ÕÀú cgi ·Î ÄÄ ÆÄÀÏÇؼ ¾µ¶§º¸´Ù ¼Óµµ¸é¿¡¼ ºü¸£´Ù. ¾Æ¹«·¡µµ ÇÑ´Ù¸® °ÉÃļ ȸ鿡 »Ñ·ÁÁÖ´Â °Íº¸ ´Ù´Â ºü¸£Áö¾Ê°Ú´Â°¡? µÎ¹ø°´Â Apache ¿¡¼ Á¦°øÇÏ´Â ±â´ÉµéÀ» ÃæºÐÈ÷ º¹ÇÕÇؼ »ç¿ë ÇÒ ¼ö ÀÖ´Ù. cgi ¸¦ ÅëÇÏ°Ô µÇ¸é Apache ÀÇ ¸î°¡Áö ±â´ÉµéÀ» ¾µ ¼ö ¾ø°Ô µÇ´Â °Íµµ ÀÖ ´Ù. install ½ÇÇà½Ã ´ÙÀ½ÀÇ Ç׸ñ¿¡¼ Y ¸¦ ÀÔ·ÂÇÑ´Ù. ±×·¯¸é libphp.a ¿Í mod_php.c, mod_php.h °¡ ¸¸µé¾îÁö°í, À̵éÀÌ Apache Web Server ÀÇ ¼Ò½º µð·ºÅ͸®·Î º¹»çµÈ´Ù. Would you like to compile PHP/FI as an Apache module? [yN] y Are you compiling for an Apache 1.1 or later server? [Yn] Does your Apache server support ELF dynamic loading? [yN] Apache source directory (which has httpd.h)? [/usr/local/etc/httpd/src] ¼Ò½º µð·ºÅ͸®¸¦ Á¤È®ÇÏ°Ô Àû¾îÁà¾ß ÇÑ´Ù. :) |