2930 ¹ø ±ÛÀÇ ´äÀå±Û: Re: Re: Re: Re: php °ü·Ã Áú¹® µå¸³´Ï´Ù. |
±Û¾´ÀÌ: °í½Â¹ü
|
±Û¾´³¯: 2012³â 04¿ù 29ÀÏ 08:39:24 ÀÏ(¿ÀÀü) |
Á¶È¸: 6639 |
69 KB(70,753 Bytes)
|
ÆÄÀϸí: php.ini.txt
|
php.ini ÆÄÀÏ¿¡¼ allow_url_fopen = On µÇ¾îÀÖ½À´Ï´Ù.
Ȥ½Ã ¸ô¶ó php 5.3.3 ¹öÀü ¼¹öÀÇ php.ini ÆÄÀÏ Ã·ºÎÇÏ¿´½À´Ï´Ù.
php -m ¸®½ºÆ®ÀÔ´Ï´Ù.
apc
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
enchant
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
memcache
mysql
mysqli
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
readline
recode
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
[»êÀÌ]´ÔÀÌ ³²±â½Å ±Û:
>±âÁ¸ ¼Ò½º¿¡¼ filesize() ÇÔ¼ö ¶óÀÎÀ» ÁÖ¼®Ã³¸®Çϸé Á¤»óÀûÀ¸·Î
´Ù¿î·ÎµåµÇ¸é
>filesize() ÇÔ¼ö¿¡¼ ¿¡·¯°¡ ³´Ù´Â ¶æÀÔ´Ï´Ù.
>
>php.ini ÆÄÀÏ¿¡¼
>
>allow_url_fopen = On
>
>À¸·Î ¼³Á¤µÇ¾î ÀÖ´ÂÁö È®ÀÎÇغ¸¼¼¿ä.
>
>
>[°í½Â¹ü]´ÔÀÌ ³²±â½Å ±Û:
>
>>´äº¯ Áּż Á¤¸» °¨»çÇÕ´Ï´Ù.
>>
>>curl ¸ðµâÀº ¿Ã¶ó¿Í ÀÖ¾ú±¸¿ä, 3¹øÀÇ filesize ºÎºÐ ÁÖ¼®Ã³¸® ÇÏ´Ï Á¤»óÀûÀ¸·Î ÆÄÀÏ
´Ù¿î·Îµå°¡ µÇ¾ú½À´Ï´Ù.
>>
>>php 5.2¿¡¼´Â µÇÁö¸¸ 5.3¿¡¼´Â ÀÛµ¿ÇÏÁö ¾Ê´Â ¿øÀεµ Á» ¾Ë ¼ö ÀÖÀ»±î¿ä?
>>
>>Âü°íÇÒ¸¸ÇÑ ¸µÅ©¶óµµ ¾Ë·ÁÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.
>>
>>
>>[»êÀÌ]´ÔÀÌ ³²±â½Å ±Û:
>>
>>>¾Æ¸¶ 5.2 ¿¡¼ 5.3 À¸·Î ³Ñ¾î¿À¸é¼ ¿¡·¯¸Þ½ÃÁö Ãâ·ÂºÎºÐ ¼³Á¤ÀÌ Á¶±Ý ¾ÈµÈ°Í
°°³×¿ä.
>>>(error_reporting)
>>>
>>>1. eregi() ÇÔ¼ö´Â 5.3 ¿¡¼ »ç¿ëÀº °¡´ÉÇϳª ÇâÈÄ¿¡ ¾ø¾îÁú°Å¶ó°í ¸Þ½ÃÁö¸¦
»Ñ·ÁÁý´Ï´Ù.
>>>µû¶ó¼ eregi ÇÔ¼ö ´ë½Å preg_match() ÇÔ¼ö¸¦ ½á¾ß ÇÕ´Ï´Ù.
>>>
>>>2. curl ¸ðµâÀÌ ¿Ã¶ó¿Í ÀÖ´ÂÁö üũ
>>>
>>>shell> php -m
>>>
>>>PHP 5.3 ÀÇ yum ¿¡´Â curl ¸ðµâÀÌ ¾ø´Â°Í °°³×¿ä.
>>>¼öµ¿À¸·Î ¼³Ä¡°¡ °¡´ÉÇÏÁö¸¸ Á¶±Ý º¹ÀâÇÕ´Ï´Ù.
>>>
>>>°°Àº ¹öÀü php ¼Ò½º¸¦ ¹Þ¾Æ¼ ¾ÐÃàÀ» Ç®°í
>>>
>>>yum -y curl-devel
>>>./configure --disable-all --with-curl=shared
>>>make
>>>ls -al modules/curl.so
>>>
>>>curl.so °¡ ¸¸µé¾îÁ³À¸¸é php.ini ÆÄÀÏ¿¡¼ extension_dir ·Î ¼³Á¤µÈ
µð·ºÅ丮¿¡
>>>curl.so ¸¦ º¹»çÇÏ°í extension = curl.so Ãß°¡
>>>
>>>±×¸®°í php -m À¸·Î curl ÀÌ ¸ðµâÀÌ ¿Ã¶ó¿À¸é
>>>
>>>apachectl restart
>>>
>>>
>>>3. filesize() ÇÔ¼ö¸¦ »ç¿ëÇÏ´Â header() ¶óÀÎÀº ÁÖ¼®Ã³¸®
>>>
>>>÷ºÎÆÄÀÏ ¹Þ¾Æ¼ Å×½ºÆ®Çغ¸¼¼¿ä.
>>>
>>>
>>>[°í½Â¹ü]´ÔÀÌ ³²±â½Å ±Û:
>>>
>>>>-----------------------------------------
>>>>´äº¯ÀÚ°¡ ±âº»ÀûÀ¸·Î Âü°íÇÒ ³»¿ëÀÔ´Ï´Ù.
>>>>- ¹èÆ÷ÆÇ(¿É¼Ç) :
>>>>- Ä¿³Î¹öÀü(¿É¼Ç) :
>>>>- µ¥¸ó¹öÀü(¿¹:apache 1.3.27) :
>>>>- µ¥¸ó¼³Ä¡À¯Çü(RPM/ÄÄÆÄÀÏ/±âŸ)
:
>>>>-----------------------------------------
>>>>*½ºÆÔÇÊÅ͸µ:ÇѱÛ
11ÀÚ ÀÌ»ó ¾øÀ¸¸é ½ºÆÔÆäÀÌÁö·Î À̵¿ÇÕ´Ï´Ù.
>>>>
>>>>±âÁ¸ À¥¼¹ö¸¦ ¹öÀü¾÷À» ÇÏ¿© ½Å±Ô À¥¼¹ö¸¦ ±¸¼ºÇÏ¿´½À´Ï´Ù.
>>>>
>>>>½Å±Ô À¥ ¼¹ö¿¡¼ ´Ù¸¥ ºÎºÐÀº ¸ðµÎ Á¤»ó ÀÛµ¿ÇÏ°í Àִµ¥ php¿¡¼ ÆÄÀÏ ´Ù¿î·Îµå
âÀ» ¶ì¿ì°í ÆÄÀÏ ´Ù¿î·Îµå ½Ã ÆÄÀÏÀÌ 0¹ÙÀÌÆ®·Î ´Ù¿î·Îµå µË´Ï´Ù.
>>>>
>>>>¾î¶² ºÎºÐÀ» È®ÀÎÇØ¹Ù¾ß ÇÏ´Â Áö Á¶¾ð ºÎŹµå¸®°Ú½À´Ï´Ù.
>>>>==============================================
>>>>OLD Server
>>>>OS : centos5.6
>>>>apache : Apache/2.2.22 (Unix)
>>>>php : PHP 5.2.17 (cli)
>>>>¼³Ä¡¹æ¹ý : ÄÄÆÄÀÏ
>>>>
>>>>New Server
>>>>OS : centos6.2
>>>>apache : Apache/2.2.15 (Unix)
>>>>php : PHP 5.3.3 (cli)
>>>>¼³Ä¡¹æ¹ý : yum install
>>>>
>>>>download.php
>>>><?
>>>>
>>>> if(eregi("(MSIE 5.0|MSIE 5.1|MSIE 5.5|MSIE 6.0)",
$_SERVER["HTTP_USER_AGENT"]) && !eregi("(Opera|Netscape)",
$_SERVER["HTTP_USER_AGENT"])) {
>>>> Header("Content-type: audio/mpeg");
>>>> Header("Content-Disposition: attachment;
filename=enjoy.mp3");
>>>> Header("Content-Length:".filesize("http://abc.com/enjoy.mp3"));
>>>> Header("Content-Transfer-Encoding: binary");
>>>> Header("Pragma: no-cache");
>>>> Header("Expires: 0");
>>>> flush();
>>>> } else {
>>>> Header("Content-type: file/unknown");
>>>> Header("Content-Disposition: attachment;
filename=enjoy.mp3");
>>>> Header("Content-Length:".filesize("http://abc.com/enjoy.mp3"));
>>>> Header("Content-Transfer-Encoding: binary");
>>>> Header("Pragma: no-cache");
>>>> Header("Expires: 0");
>>>> flush();
>>>> }
>>>>
>>>> $ch = curl_init();
>>>> curl_setopt( $ch, CURLOPT_URL, "http://abc.com/enjoy.mp3" );
>>>> curl_setopt( $ch, CURLOPT_HEADER, false );
>>>> curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
>>>> curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5 );
>>>> curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );
>>>>
>>>> print curl_exec( $ch );
>>>>?>
>>>
>>>========================================
>>
>>========================================
>
>========================================
========================================
|
ÀÌÀü±Û : Re: Re: Re: php °ü·Ã Áú¹® µå¸³´Ï´Ù.
´ÙÀ½±Û : Re: Re: Re: Re: Re: php °ü·Ã Áú¹® µå¸³´Ï´Ù.
|
from 116.122.186.121
JS(Redhands)Board 0.4 +@
|
|