Article ID: 125759, created on Jun 5, 2015, last review on Jun 5, 2015

  • Applies to:
  • H-Sphere 3.6.3

Symptoms

PHP function file_get_contents causes the issue with Apache/PHP segfaulting:

In Apache log file /hsphere/local/var/httpd/logs/error_log :

[Tue Jun 02 17:42:48 2015] [notice] child pid 32760 exit signal Segmentation fault (11)
[Tue Jun 02 17:42:48 2015] [notice] child pid 325 exit signal Segmentation fault (11)
[Tue Jun 02 17:42:48 2015] [notice] child pid 329 exit signal Segmentation fault (11)
[Tue Jun 02 17:42:48 2015] [notice] child pid 330 exit signal Segmentation fault (11)

The issue is reproduced on php_libphp5 mode only.

Cause

PHP BUG https://bugs.php.net/bug.php?id=54381

Resolution 1

Use alternative function:

    <?php
    function get_content($URL){
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       curl_setopt($ch, CURLOPT_URL, $URL);
       $data = curl_exec($ch);
       curl_close($ch);
       return $data;
    }

    $filecontent = get_content("URL");

Resolution 2

Change PHP Mode to "fast-cgi".

Search Words

url_get_contents

Segmentation fault (11)

file_get_contents

php_libphp5

6b908665c0d1eca5bdd0141a32fd712a 6311ae17c1ee52b36e68aaf4ad066387 f213b9fa8759d57bee5d547445806fe7 2e39a5e5b1423cc126cf735bac076008

Email subscription for changes to this article
Save as PDF