Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 | 31 |
Tags
- MYSQL
- java
- 주식
- 코드이그나이터
- 주식 청약
- 리눅스
- Eclipse
- Oracle
- 맥
- 주식 청약 일정
- 공모주 청약
- 자바스크립트
- css
- 공모주
- jquery
- Stock ipo
- 공모주 청약 일정
- 6월 공모주 청약 일정
- JavaScript
- linux
- 7월 공모주 청약 일정
- 제이쿼리
- codeigniter
- Stock
- SQL
- IPO
- 오라클
- 자바
- php
- html
Archives
- Today
- Total
개발자의 끄적끄적
[php] allow_url_fopen / wrapper is disabled in the server configuration by allow_url_fopen=0 에러 해결 방법 본문
개발/php
[php] allow_url_fopen / wrapper is disabled in the server configuration by allow_url_fopen=0 에러 해결 방법
효벨 2023. 9. 11. 01:00728x90
반응형
[php] allow_url_fopen / wrapper is disabled in the server configuration by allow_url_fopen=0 에러 해결 방법
php 에서
파일 다운로드 기능을 구현하다보면
서버에 있는 파일이 아닌, url만 가지고 파일을 다운로드 해야 하는 경우가 있습니다.
그럴때 아래와 같이
file_get_contents 를 이용해서 파일정보를 가져오는데요!
$data = file_get_contents($file_url);
file_get_contents 가 정상적으로 실행이 되지 않고,
아래와 같이 allow_url_fopen 에러가 나는 경우가 있습니다!
wrapper is disabled in the server configuration by allow_url_fopen=0
allow_url_fopen 설정은 php.ini 에서 설정할 수 있지만,
클라우드나 호스팅서버의 구성에 따라 파일을 수정할 수 없는 경우도 있습니다!
그럴때는 아래와 같이
ini_set("allow_url_fopen", 'On'); 을
file_get_contents 위에 선언해주시고,
다시 실행해보면 정상적으로 다운로드가 되실겁니다!
ini_set("allow_url_fopen", 'On');
$data = file_get_contents($file_url);
참고들 하세요!
반응형
'개발 > php' 카테고리의 다른 글
[php/codeigniter] codeigniter3 session unset example/ 코드이그나이터3 세션 변수 삭제 방법 (0) | 2023.11.07 |
---|---|
[php] 이름에서 성 빼고 마스킹처리하는 함수 (0) | 2023.09.30 |
[php/codeigniter] 코드이그나이터4 index.php service 500 에러 해결방법 (0) | 2023.09.10 |
[php/library] PBKDF2 ERROR: Something's wrong with your hash! 에러 해결방법 (0) | 2023.09.09 |
[php/codeigniter] The action you have requested is not allowed 에러 해결방법 (0) | 2023.09.08 |
Comments