Bug 590054 - php is unable to use fopen functions on remote urls when apache is started automatically by upstart at boot
Summary: php is unable to use fopen functions on remote urls when apache is started au...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-07 15:34 UTC by Tony White
Modified: 2010-05-08 13:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-08 13:13:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tony White 2010-05-07 15:34:51 UTC
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 16:03:44 UTC
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 17:19:47 UTC
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 13:13:12 UTC
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.