Why does php sleep() return immediately when httpd restarts gracefully.

Solution Unverified - Updated -

Issue

  • Why does php sleep() return immediately when httpd restarts gracefully.

Sample php script using sleep();

# cat /var/www/html/test1.php 
<?php
  echo "Hello World\n";
  sleep(30);
?>

Run "curl http://webserver/test1.php" on client and run "service httpd graceful" on webserver.

Sample output

# date; curl http://webserver/test1.php; date
Thu Mar 10 10:19:00 JST 2016
Hello World
Thu Mar 10 10:19:03 JST 2016

Environment

  • Red Hat Enterprise Linux 6
  • httpd
  • php

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content