php error file_get_contents()
内部邀请码:C8E245J (不写邀请码,没有现金送)
国内私募机构九鼎控股打造,九鼎投资是在全国股份转让系统挂牌的公众公司,股票代码为430719,为“中国PE第一股”,市值超1000亿元。
piwik 放在服务器跑时,出现如下错误:
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/apache2/htdocs/heshun/kkk/zz.php on line 99
Warning: file_get_contents(http://www.php.net): failed to open stream: Invalid argument in /usr/local/apache2/htdocs/heshun/kkk/zz.php on line 99
to my surprise, when I log into my local net(BSD OS, PHP 4.3.10 ) and I run it by following:
google 了一把,检查如下问题:
1、检查 php.ini 的配置 allow_url_fopen 是否为 on
2、检查 dns 错误,直接在 /etc/resolve.conf 添加 dns 服务器即可。
比如:
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
# NETCONFIG_DNS_STATIC_SEARCHLIST
# NETCONFIG_DNS_STATIC_SERVERS
# NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
# NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
#
### Please remove (at least) this line when you modify the file! nameserver 10.30.1.9
nameserver 10.30.1.10
php error file_get_contents()的更多相关文章
- CVE-2021-3129:Laravel远程代码漏洞复现分析
摘要:本文主要为大家带来CVE-2021-3129漏洞复现分析,为大家在日常工作中提供帮助. 本文分享自华为云社区<CVE-2021-3129 分析>,作者:Xuuuu . CVE-202 ...
- file_get_contents HTTP request failed! Internal Server Error
使用file_get_contents报错 Severity: WarningMessage: file_get_contents(http://geetest.com:8000/select?gid ...
- PHP使用file_get_contents或curl请求https的域名内容为空或Http 505错误的问题排查方法
前段日子,突然接到用户的反馈,说系统中原来的QQ登录.微博登录通通都不能用,跟踪代码进去后发现,是在 file_get_contents这个函数请求QQ登录的地方报错,在用该函数file_get_co ...
- ubuntu下file_get_contents返回空字符串
ubuntu下file_get_contents返回空字符串 | 浏览:302 | 更新:2014-03-30 10:11 本文起初面临的问题是PHP中SoapClient不好使,最后file_get ...
- 跨域、curl、snoopy、file_get_contents()
定义:可以称为”信息采集/模拟登录”技术,可以实现对某个地址做请求,同时按照要求传递get或post参数. curl本身是php的一个扩展,同时也是一个利用URL语法规定来传输文件和数据的工具,支持很 ...
- PHPsocket、CURL、File_get_contents采集
1.socket采集.采用最底层的,它只是建立一个长连接,然后我们自己构造http协议字符串去发送请求.例如想获取这个页面内容(http://tv.youku.com/?spm=a2hww.20023 ...
- 比 file_get_contents() 更优的 cURL 详解(附实例)
PHP 可以使用 file_get_content() 函数抓取网页内容,但却无法进行更复杂的处理,譬如文件的上传或下载. Cookie 操作等等.而 cURL 提供了这些功能. 一.cURL简介 在 ...
- file_get_contents函数
今天迁移一个SDK项目到新的机子上,发现项目无法跑起来,报500错误,通过分析,发现原来是file_get_contents函数再作怪,代码如下 public function __construct ...
- PHP函数file_get_contents()使用 https 协议时报错:SSL operation failed
场景: file_get_contents() 函数是用于将文件的内容读入到一个字符串中,是读取文件内容常用的函数之一. 但是有时在服务器上使用file_get_contents() 函数请求http ...
随机推荐
- objective-c里的方法指针IMP的用法
SGPopSelectView.h @interface SGPopSelectView : UIView @property (nonatomic, assign) SEL selector; @p ...
- RTSP协议学习笔记
一. RTSP协议概述 RTSP(Real-Time Stream Protocol )是一种基于文本的应用层协议,在语法及一些消息参数等方面,RTSP协议与HTTP协议类似. RTSP ...
- uestc 1720无平方因子数
求素数 然后容斥原理// n之内有平方因子的数的个数sum =n/(2^2) + n/(3^2)+……+n/(k^2) - n/(2^2 * 3^2)-……+……. // #pragma commen ...
- java web 学习三(Tomcat 服务器学习和使用2)
一.打包JavaWeb应用 在Java中,使用"jar"命令来对将JavaWeb应用打包成一个War包,jar命令的用法如下:
- lightoj 1021 (数位DP)
题意:给你一个b进制的数,再给你一个十进制数k,你可以重新排列b进制数的每一位得到其他b进制数,问你这些数中有多少可以整除k? 思路:数位dp. #include <cstdio> #in ...
- 帮同事写了几行代码,在 安装/卸载 程序里 注册/卸载 OCX控件
写了个小控制台程序,这个程序用来注册 / 卸载OCX控件,用在Inno Setup做的安装卸载程序里. #include "stdafx.h" #include <windo ...
- ios游戏开发--cocos2d学习(2)
在第一节中简单介绍了2d项目模板HelloWorld的基础代码,并做了一点小小的改变,像触摸接收.旋转.移动和颜色转变序列CCSequence的使用等等,2d本身封装好了很多方便使用的动作,只需要调用 ...
- LeetCode题解——Roman to Integer
题目: 将罗马数字转换为整数. 解法: 可以参考上一篇数字转换为罗马数字的规则. 代码: class Solution { public: int sym2int(char sym) //罗马数字字符 ...
- 当rsync遇到非默认端口的ssh
在使用rsync使用ssh协议,来同步远程文件的方法,rsync -zvrtopg -e ssh但是如果遇到ssh不是22端口的时候使用rsync -zvrtopg -e ‘ssh -p 端口’特别是 ...
- udp通信C++实现的细节
在windows/linux下有下面结构: sockaddr结构 struct sockaddr { unsigned short sa_family;/*addressfamily,AF_ ...