From 19700ca6da1c926267fa301c6b9bb5fe0a670fa2 Mon Sep 17 00:00:00 2001 From: luckyjay Date: Sat, 9 Jan 2016 23:49:37 -0500 Subject: [PATCH 1/5] Remove clipRect setting to fix rendering It seems the clipRect setting was preventing phantom from rendering anything. I think after this and my previous pull request, phantomJS is working now. --- phantom.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phantom.js b/phantom.js index 7124e70..822c7b4 100644 --- a/phantom.js +++ b/phantom.js @@ -13,7 +13,6 @@ var js = input[4]; var pageWidth = (vp_w!="")?parseInt(vp_w, 10):1024; var pageHeight = (vp_h!="")?parseInt(vp_h, 10):'auto'; page.viewportSize = { width: pageWidth, height: pageHeight }; -page.clipRect = { top: 0, left: 0, width: pageWidth, height: pageHeight }; page.settings['javascriptEnabled'] = (js=="no")?false:true; page.open(address, function (status) { @@ -26,4 +25,4 @@ page.settings['javascriptEnabled'] = (js=="no")?false:true; phantom.exit(); }, 200); } - }); \ No newline at end of file + }); From 6fefefdfb5ffd0dfb68d45762c0290897e269e09 Mon Sep 17 00:00:00 2001 From: luckyjay Date: Sat, 9 Jan 2016 23:52:12 -0500 Subject: [PATCH 2/5] Update http2pic.class.php --- http2pic.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/http2pic.class.php b/http2pic.class.php index 54d5f35..3954e9c 100644 --- a/http2pic.class.php +++ b/http2pic.class.php @@ -155,7 +155,6 @@ class http2pic $cmd.= ','.$this->params['js']; $cmd = escapeshellcmd($cmd); - exit($cmd); shell_exec($cmd); $this->params['cmd'] = $cmd; @@ -304,4 +303,4 @@ class http2pic return true; return false; } -} \ No newline at end of file +} From fd553e72ea2e3d281151c2010f1c3d392a408417 Mon Sep 17 00:00:00 2001 From: luckyjay Date: Sun, 10 Jan 2016 01:09:57 -0500 Subject: [PATCH 3/5] Change curl opts to improve reachable test isURLReachable would fail for certain sites, such as Amazon.com. Removing NOBODY and adding RETURNTRANSFER solved the issue for me. --- http2pic.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http2pic.class.php b/http2pic.class.php index 3954e9c..c4db38c 100644 --- a/http2pic.class.php +++ b/http2pic.class.php @@ -279,7 +279,7 @@ class http2pic function isURLReachable($url) { $ch = curl_init($url); - curl_setopt($ch, CURLOPT_NOBODY, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); From 84bad66c6ac17223d5425afeeee10703a1dcba86 Mon Sep 17 00:00:00 2001 From: luckyjay Date: Sun, 10 Jan 2016 01:25:06 -0500 Subject: [PATCH 4/5] Update http2pic.class.php --- http2pic.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http2pic.class.php b/http2pic.class.php index c4db38c..0481b68 100644 --- a/http2pic.class.php +++ b/http2pic.class.php @@ -146,7 +146,7 @@ class http2pic function renderPagePHANTOMJS() { $cmd = 'timeout '.$this->params['timeout'].' '.PHANTOMJSPATH; - $cmd.= ' '.__DIR__.'/phantom.js '; + $cmd.= ' --ignore-ssl-errors=yes '.__DIR__.'/phantom.js '; $cmd.= ($this->params['url']); $cmd.= ','.($this->params['file']); From d63cee86a64155946d8a3bc14a494af8e6daac4c Mon Sep 17 00:00:00 2001 From: luckyjay Date: Sun, 10 Jan 2016 02:07:06 -0500 Subject: [PATCH 5/5] Update http2pic.class.php --- http2pic.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http2pic.class.php b/http2pic.class.php index 0481b68..231a62b 100644 --- a/http2pic.class.php +++ b/http2pic.class.php @@ -146,7 +146,7 @@ class http2pic function renderPagePHANTOMJS() { $cmd = 'timeout '.$this->params['timeout'].' '.PHANTOMJSPATH; - $cmd.= ' --ignore-ssl-errors=yes '.__DIR__.'/phantom.js '; + $cmd.= ' --ignore-ssl-errors=yes --ssl-protocol=any '.__DIR__.'/phantom.js '; $cmd.= ($this->params['url']); $cmd.= ','.($this->params['file']);