본문 바로가기
카테고리 없음

PHP curl enable 시키기 windows

by GoodDev 2018. 9. 14.

Step1: Uncomment the php_curl.dll from php.ini


Step2: Copy the following three files from php installed directory.i.e "C:\\php7".


libeay32.dll,

libssh2.dll,

ssleay32.dll


Step3: Paste the files under two place


httpd.conf's ServerRoot directive. i.e "C\Apache24"

apache bin directory. i.e "C\Apache24\bin"


Step4: Restart apache.



        $c = curl_init($pageUrl);

        curl_setopt($c, CURLOPT_RETURNTRANSFER, true);

        

        if (curl_error($c)) {

            $result->message = curl_error($c);

            $result->url = $pageUrl;

            $result->result = "NOK";

                   

        } else {

            // Get the status code

            $status = curl_getinfo($c, CURLINFO_HTTP_CODE);

            curl_close($c);

            

            $dom = new simple_html_dom();

            $dom->load(curl_exec($ch));

            

            if ( $html > 0 ) {

                $result->message = "저장 되었습니다.";

                $result->url = $pageUrl;

                $result->result = "OK";

            } else {

                $result->message = "오류가 발생되었습니다. 관리자에게 문의하시기 바랍니다.";

                $result->url = $pageUrl;

                $result->result = "NOK";

            }

        }


댓글