php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63102 built in server can not file_get_contents file of the same domain
Submitted: 2012-09-17 15:45 UTC Modified: 2012-09-17 18:55 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: eward dot song at gmail dot com Assigned:
Status: Not a bug Package: Built-in web server
PHP Version: 5.4Git-2012-09-17 (Git) OS: mac os x
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eward dot song at gmail dot com
New email:
PHP Version: OS:

 

 [2012-09-17 15:45 UTC] eward dot song at gmail dot com
Description:
------------
the situation is that: 
run a php build in server, use commend: php -S 127.0.0.1:8081, and in you current 
dir, there are two file: a.php and b.php . a.php use file_get_contents catch a 
file:
<?php
echo file_get_contents('http://127.0.0.1:8081/b.php');
?>
b.php just  print string 'hello world'. When run the a.php through the web 
browser, you can find that, the build in server return 'failed to open stream: 
HTTP request failed!'.
If just browser the b.php, you can get hello world current, and if the file at 
a.php is not a http request which domain is the same of a.php, such as 'b.php', 
or 'http://google.com/', server is all right.
This kind problem do not occur when use apache as cgi.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-17 18:55 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2012-09-17 18:55 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The embedded server is single-threaded. Currently there are no plans to change that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 21:01:28 2024 UTC