Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 590054 - php is unable to use fopen functions on remote urls when apache is started automatically by upstart at boot
php is unable to use fopen functions on remote urls when apache is started au...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Joe Orton
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-07 11:34 EDT by Tony White
Modified: 2010-05-08 09:13 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-08 09:13:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tony White 2010-05-07 11:34:51 EDT
Description of problem:
php is unable to fopen. httpd it is started before name resolution.

Version-Release number of selected component (if applicable):
Apache/2.2.15 (Fedora)

How reproducible:
Every boot

Steps to Reproduce:
1. Boot your fedora LAMP server setup
2. Try to use an fopen php 5 function to retrieve a remote url using a php script (simplepie is a good one to try.)
3. Inspect the logs, there should be something like :
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in ...
  
Actual results:
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in ...
In the logs and the data from the url is not fetched.

Expected results:
Data from the url is fetched. No error message.

Additional info:
Restarting the httpd service solves the issue.
It is exactly this problem :
http://www.php.net/manual/en/function.fopen.php#33228
So if you reboot a fedora server, php fopen requests will not function because httpd is started before the name resolution occurs unless you restart httpd.

I have no idea if this bug should be against upstart or apache.
Comment 1 Mohamed El Morabity 2010-05-07 12:03:44 EDT
Anyway this bug doesn't rely on apache-commons-exec which is a Java library.
Changed "Component" field to "php".
Comment 2 Remi Collet 2010-05-07 13:19:47 EDT
For me, this is not a bug.

You are probably using NetworkManager, switch to network if you want a server with all daemon up in the right order.

Else (for a dev computer), don't start httpd à boot time.
Comment 3 Joe Orton 2010-05-08 09:13:12 EDT
Agree with Remi.  If you want to stick with NetworkManager, you can do:

  # echo NETWORKWAIT=1 >> /etc/sysconfig/network

to force NM to wait for a network at bootup.

Note You need to log in before you can comment on or make changes to this bug.