<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5">
</HEAD>
<BODY>
Hi folks,<BR>
<BR>
I use the cURL extension in PHP to fetch remote web pages on Tool Labs. <BR>
It works perfectly on Tool Labs when the script is run manually with <BR>
the php command (on tools-login). However, when the PHP script is <BR>
accessed from a browser (the script runs on an exec node), cURL <BR>
mysteriously fails for some pages, returning an empty string for the <BR>
curl_exec() call. Anyone can figure out what's wrong? An example of <BR>
such pages is <A HREF="http://www.geoffreylandis.com/vacuum.html">http://www.geoffreylandis.com/vacuum.html</A><BR>
<BR>
I've built a simple test script on <A HREF="https://github.com/zhaofengli/stuff/blob/master/labs-connrst.php">https://github.com/zhaofengli/stuff/blob/master/labs-connrst.php</A> ,<BR>
and you can test it by:<BR>
1. running the script on your own box or on Tool Labs, with the php <BR>
command (It should work with 200 in http_code and a non-zero <BR>
size_download value)<BR>
2. copying the script to your public_html and accessing it from your <BR>
browser (It should fail with 0 in http_code and a zero size_download <BR>
value)<BR>
<BR>
Background: <A HREF="https://github.com/zhaofengli/refill/issues/11">https://github.com/zhaofengli/refill/issues/11</A><BR>
<BR>
Zhaofeng Li
</BODY>
</HTML>