일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- curl
- variables
- string
- php
- date
- 웹하드추천
- 전략
- file-upload
- Session
- Ajax
- MySQL
- HTML
- 웹하드순위
- 경영
- 무료다운로드쿠폰
- Apache
- JavaScript
- Forms
- UTF-8
- composer-php
- function
- Arrays
- jquery
- OOP
- Laravel
- Regex
- Linux
- JSON
- post
- Today
- Total
개발! 딱 깔끔하고 센스있게!
PHP : file_get_contents ($ loc) 실패 본문
나는 방금 로컬 호스트를 원격 서버로 옮겨서 나의 일부 스크립트가 중단되었다.
가장 중요한 것은 file u get conents () 다른 스크립트에서 json 값을 얻는 것이다.
php 버전은 5.2.4.URL 열기 허용
Warning:
file_get_contents()
[function.file-get-contents]
:php_network_getaddresses
:getaddrinfo
failed: Name or service not known in/var/www/html/2009/functions/functions.products.php
online 5
Warning:
file_get_contents(http://data.example.com/new-data.php) [function.file-get-contents]
: failed to open stream:Success in /var/www/html/2009/functions/functions.products.php
online 5
스크립트 실행 위치: http: / www.example.com함수에 전달된 위치는 http://data.example.com /new -data.php
주의: 같은 도메인 이름, 다른 서버 두 개 있습니다.
function getData() { $location = "http://data.mysite.com/new-data.php"; $contents = file_get_contents($location); $jsonVars = json_decode($contents); return $jsonVars }
대답
Name or service not known
DNS 끊기.당신은 기계에 있는 shell ping data.my site.com (가설 당신은 shell)?
잠시 고정된 IP 주소로 data.my site.com 교체를 시도합니다.
'개발 스크랩 메모 > PHP' 카테고리의 다른 글
Php 연중 무휴로 이동하는 방법 (0) | 2020.12.14 |
---|---|
javascript 와 PHP 를 사용하여 이메일을 보내는 간단한 방법. [닫기] (0) | 2020.12.14 |
PHP JSON 디코드-stdClass (0) | 2020.12.13 |
PHP 로 mysql 재귀나무에 도달한다 (0) | 2020.12.13 |
nohup : 백그라운드에서 PHP 프로세스 실행 (0) | 2020.12.13 |