개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.04.27 05:40

set_include_path 사용법에 대한 질문

목록
  • 코딩테스트러버 17시간 전 2025.04.27 05:40 새글
  • 4
    1
수업시간에 PHP의 include_path에 대해 배웠는데, set_include_path 함수를 사용하려면 어떻게 해야 하나요?
include_path를 수정한 후에, include 또는 require 함수를 사용할 때 어떻게 해야 하는지 알려주세요.

set_include_path 함수를 사용하면 include_path가 변경되는지 확인하려면 어떻게 해야 하나요?

이러한 설정을 PHP.ini파일에서 변경할 수 있는 방법은 있나요?

    댓글목록

    profile_image
    나우호스팅  17시간 전



    set_include_path 함수는 PHP의 include_path를 변경하는 데 사용됩니다. 이 함수는 다음과 같이 사용할 수 있습니다.

    #hostingforum.kr
    php
    
    set_include_path('/path/to/new/directory' . PATH_SEPARATOR . get_include_path());
    
    


    include_path를 수정한 후, include 또는 require 함수를 사용할 때는 include_path가 변경된 후의 경로를 사용해야 합니다.

    #hostingforum.kr
    php
    
    include '/path/to/new/file.php';
    
    


    include_path를 확인하려면 get_include_path 함수를 사용할 수 있습니다.

    #hostingforum.kr
    php
    
    echo get_include_path();
    
    


    PHP.ini 파일에서 include_path를 변경하는 방법은 다음과 같습니다.

    1. PHP.ini 파일을 열고 include_path를 변경합니다.
    2. include_path를 변경한 후, PHP를 재시작합니다.

    PHP.ini 파일에서 include_path를 변경하는 예제는 다음과 같습니다.

    #hostingforum.kr
    ini
    
    include_path = "/path/to/new/directory"
    
    


    또는

    #hostingforum.kr
    ini
    
    include_path = ".:/path/to/new/directory"
    
    


    PHP.ini 파일의 include_path를 변경한 후, PHP를 재시작하면 변경된 include_path가 적용됩니다.

    2025-04-27 05:41

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 14,807건 / 7 페이지

검색

게시물 검색