apache + php + curlã§å¤é¨Webãµã¼ãã«ã¢ã¯ã»ã¹ã§ããªãã¦ã¯ã¾ã£ã
æ°ãããµã¼ããæ§ç¯ããã¨ãã«ã¯ã¾ã£ãã®ã§ã¡ã¢ã
ç°å¢ã¯php5 + curlãWebãã¼ã¸ã¨ãã¦ã¢ã¯ã»ã¹ããã¨ãã«ãããã°ã©ã ã§curlã®ã¢ã¸ã¥ã¼ã«ãç¨ãã¦å¤é¨ã®Webãµã¼ãã«ã¢ã¯ã»ã¹ãããã®çµæã«åºã¥ãã¦å¦çãè¡ãã
èµ·ããç¾è±¡ã¯ãWebãã¼ã¸ã¨ãã¦ã¢ã¯ã»ã¹ããã¨ãã«å¤é¨ãµã¼ãã«æ¥ç¶ã§ãããæå¾ ããçµæãå¾ãããªãã£ããã¨ã
curlã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã確èªããã¨ã
- ã¨ã©ã¼çªå·: 6
- ã¡ãã»ã¼ã¸: Couldn't resolve host '....'
ã¨ã©ã¼ã¡ãã»ã¼ã¸ãããURLã®åå解決ãã§ãã¦ããªãã¨ãããã¨ãå¤æã
ã§ãã¯ã¾ã£ãã®ã¯ããããã
ã©ããã¦åå解決ã§ãã¦ããªããã調ã¹ãããã«ä»¥ä¸ã試ããã
- nslookupã³ãã³ãã§å¤é¨ãµã¼ãã®ååã解決ãããã
- pingã³ãã³ãã§å¿çããããã
- wgetã³ãã³ãã§è©²å½URLã®ãªã¯ã¨ã¹ãçµæãåå¾ã§ãããã
- curlã³ãã³ãã§ã§è©²å½URLã®ãªã¯ã¨ã¹ãçµæãåå¾ã§ãããã
ãã¹ã¦åé¡ãªããã¤ã¾ãåå解決ã¯ã§ãã¦ããããã®æç¹ã§ãåå ã®è¦å½ãã¤ããªããªããè²ã 調ã¹ãã
調ã¹ã¦ããä¸ã§ãä»åæ§ç¯ãããµã¼ãã®/etc/hostsã«è©²å½URLãç´æ¥æ¸ãã¦ã¿ã¦ã¯ã©ããã¨ã¢ããã¤ã¹ããããã試ããã¨ãããæ¥ç¶ã§ããã
ã²ã¨ã¾ãåé¡ã解決ã§ããã®ã ããä½ã解ããªãã
ããã«èª¿æ»ãã¦ããã¨ã [SOLVED] cURL, PHP, Apache, Insanity! (Page 1) / Networking, Server, and Protection / Arch Linux Forumsã®ããã¨ãèªãã§ãã¦ããµã¨/etc/resolve.confãæ¸ãæããããå¯è½æ§ãæãã¤ãã
ã¾ããpsã³ãã³ãã®httpdããã»ã¹ã®STARTã¨ã/etc/resolve.confã®ã¿ã¤ã ã¹ã¿ã³ããæ¯è¼ã/etc/resolve.confã®æ¹ãå¾ã§ãããã¨ãå¤æã
ããã¦ããã®ä»¶ãç¥ã£ã¦ããããªäººã«èããã¨ããããã®å¯è½æ§ã¯ããã¨ããçãã
ããã§ã/etc/hostsã®è¨å®ãå ã«æ»ãã¦httpdãåèµ·åãWebãã¼ã¸ã«ã¢ã¯ã»ã¹ããã¨ãããåé¡ã解決ãããã
çµæããè¦ã¦ã/etc/resolve.confãç·¨éãããhttpdã¯åèµ·åãã¹ãã ãã¨ããã®ããä»åã®èªåã®çµè«ã