草庐IT

Contents

全部标签

PHP 警告 : file_get_contents failed to open stream: HTTP request failed! HTTP/1.1 400 错误请求

我已经使用Codeigniter构建了一个本地DVD数据库,其中包含电影名称等。我想要做的是从thisIMDBAPI加载更多电影数据。.但是我收到以下错误:APHPErrorwasencounteredSeverity:WarningMessage:file_get_contents(http://www.imdbapi.com/?i=&t=2Fast2Furious)[function.file-get-contents]:failedtoopenstream:HTTPrequestfailed!HTTP/1.1400BadRequestFilename:controllers/dv

php - 为什么相同的输入返回两个不同的 MD5 哈希值?

好的,我有两个文件。它们完全相同。第一个文件是:http://iadsonline.com/servconfig.php第二个文件是:http://xzerox.info/servconfig.php但是,当我使用md5_file()获取他们的MD5时,他们返回两个不同的MD5。第一个返回cc7819055cde3194bb3b136bad5cf58d,这是不正确的,第二个返回96a0cec80eb773687ca28840ecc67ca1,这是正确的。文件只是一个 为了验证,我使用了这段代码:$contents=file_get_contents($URL);echohtmlenti

PHP 评估后的 PHP file_get_contents

我知道如何使用file_get_contents和fopen等,但是当我对自己的文件之一执行此操作时,我得到的是文字字符串,也就是说,代码没有经过预处理!我如何在不使用require等的情况下从文件中导入文本,因为我想将值存储到字符串中 最佳答案 参见themanual上的示例#5和#6.直接从那里获取:$string=get_include_contents('somefile.php');functionget_include_contents($filename){if(is_file($filename)){ob_start

php - file_get_contents 对 'https://en.wikipedia.org/wiki/Category:Upcoming_singles' 的变量响应

file_get_contents('https://en.wikipedia.org/wiki/Category:Upcoming_singles');使用Chrome网络浏览器访问同一地址(显示4种产品)返回不同的响应(2种产品)。经检查,我怀疑这可能与有关Savedinparsercachekeywith...timestamp...在返回的html中。当我使用file_get_contents()时,时间戳较旧关于如何使用file_get_contents()获取最新信息有什么想法吗?谢谢! 最佳答案 假设file_get_

php - 性能 : file_get_contents(), 相对和绝对 URL

如果我在file_get_contents()中使用相对路径作为参数,是否有任何性能优势?file_get_contents("../../mypage.php");v/sfile_get_contents("http://.../mypage.php");内部如何处理file_get_contents()? 最佳答案 使用本地文件与使用远程文件肯定会有明显的性能差异-即使“远程”文件位于您的本地服务器上。当您使用本地/相关文件时,例如file_get_contents("../../mypage.php");,它会直接在服务器上加

php - 使用 PHP AWS SDK 在 file_put_contents 上设置 ACL

require'vendor/autoload.php';useAws\S3\S3Client;$client=S3Client::factory(array('key'=>'MY_KEY','secret'=>'MY_SECRET'));//Registerthestreamwrapperfromaclientobject$client->registerStreamWrapper();$data=$_POST["image_data"];list($type,$data)=explode(';',$data);list(,$data)=explode(',',$data);$dat

php - file_get_contents false 当 url 有空格时(编码一切都不起作用)

所以,问题出在这一行$imageString=file_get_contents($image_url);具有空格字符的url不起作用。但是如果我让$imageString=file_get_contents(urlencode($image_url));没有任何效果。我一直在变量中收到false。ulr是这样的:https://s3-eu-central-1.amazonaws.com/images/12/Screenshotfrom2016-04-281815:54:20.png 最佳答案 使用这个函数functionescap

php - 文件获取内容(): No such host is known error

我正在使用file_get_contents函数将URL转换为字符串:$contents=file_get_contents("http://google.com");但是,我收到以下错误:file_get_contents()[function.file-get-contents]:php_network_getaddresses:getaddrinfofailed:Nosuchhostisknown.如何在我的本地主机上解决这个问题? 最佳答案 您的“本地主机”无法将名称google.com解析为IP地址,这意味着您的机器无法/

PHP file_get_contents() 不工作

谁能解释为什么下面的代码会返回警告:我收到警告:Warning:file_get_contents(http://google.com):failedtoopenstream:Nosuchfileordirectoryonline2参见codepad 最佳答案 作为替代方案,您可以使用cURL,例如:$url="http://www.google.com";$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_RETURNTRANSFER,

php - 如何修复 php 警告 : file_get_contents? 无法打开流:HTTP 请求失败

如何修复php警告:file_get_contents?Warning:file_get_contents(http://192.168.1.254:9999/api/p/internal/ucenter/login?loginName=test102&password=111111)[function.file-get-contents]:failedtoopenstream:HTTPrequestfailed!HTTP/1.1400BadRequestin/Applications/XAMPP/xamppfiles/htdocs/PHP_test/index.phponline49