|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2015-10-30 03:32 UTC] requinix@php.net
 
-Status: Open
+Status: Not a bug
  [2015-10-30 03:32 UTC] requinix@php.net
  [2015-10-30 13:20 UTC] abhatnagar at blackberry dot com
  [2015-10-30 18:50 UTC] requinix@php.net
 
-Status: Not a bug
+Status: Feedback
  [2015-10-30 18:50 UTC] requinix@php.net
  [2015-11-08 04:22 UTC] php-bugs at lists dot php dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
Description: ------------ Command Line curl output with linefeeds. Displayed correctly in terminal. curl -vvv 'localhost:9200/_cat/nodes/?v' * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 9200 (#0) > GET /_cat/nodes/?v HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:9200 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/plain; charset=UTF-8 < Content-Length: 357 < host ip heap.percent ram.percent load node.role master name es-thr-hdp-02.dbplat.altus.bblabs.rim.net 10.236.133.15 3 55 0.01 d m es-thr-hdp-02 es-thr-hdp-01.dbplat.altus.bblabs.rim.net 10.236.133.17 9 56 0.00 d * es-thr-hdp-01 Same output in php displayed out put in browser without linefeed as a single line: HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Content-Length: 357 host ip heap.percent ram.percent load node.role master name es-thr-hdp-02.dbplat.altus.bblabs.rim.net 10.236.133.15 3 55 0.00 d m es-thr-hdp-02 es-thr-hdp-01.dbplat.altus.bblabs.rim.net 10.236.133.17 9 56 0.00 d * es-thr-hdp-01 Test script: --------------- function get_web_page( $url ) { $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => true, // don't return headers CURLOPT_VERBOSE => true, // CURLOPT_CRLF => true, // CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 5, // timeout on connect CURLOPT_TIMEOUT => 5, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), // ); .... $url = "http://$master_nodes:9200/_cat/nodes?v"; echo "<br>"; $curl_response = get_web_page( $url ); echo $curl_response['content']; echo "<br>"; Expected result: ---------------- Output should be on different lines: as below HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Content-Length: 357 host ip heap.percent ram.percent load node.role master name es-thr-hdp-02.dbplat.altus.bblabs.rim.net 10.236.133.158 3 55 0.00 d m es-thr-hdp-02 es-thr-hdp-01.dbplat.altus.bblabs.rim.net 10.236.133.157 9 56 0.00 d * es-thr-hdp-01 Actual result: -------------- HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Content-Length: 357 host ip heap.percent ram.percent load node.role master name es-thr-hdp-02.dbplat.altus.bblabs.rim.net 10.236.133.158 3 55 0.00 d m es-thr-hdp-02 es-thr-hdp-01.dbplat.altus.bblabs.rim.net 10.236.133.157 9 56 0.00 d * es-thr-hdp-01 Note: Content Array returned has only 1 element for single line.