Results 1 to 4 of 4

Thread: สอบถามปัญหาการใช้งาน include ใน php

  1. #1
    Member
    Join Date
    Jul 2009
    Location
    Dindaeng
    Posts
    51


    include(".../config.inc.php");

    จากโค๊ดอันนี้อ่ะครับ เป็นการ include ไฟล์ up directory นั่นคือเรียกไฟล์จากไดเรคทอรี่ก่อนหน้า

    แต่ว่าใน Linux เนี่ย มันไม่สามารถ include มาได้ครับ ผมลองใน windows แล้วสามารถ include ได้

    ถ้าผมลอง include("config.inc.php"); หรือ include("folderA/folderB/config.inc.php");

    include ใน sub directory ได้ แต่ว่าทำไม include directory ก่อนหน้าไม่ได้ล่ะครับ

    มีวิธีตั่้งค่าให้สามารถทำได้ไหมคับ

    ผมลองจาก IIS+PHP แล้วทำได้ครับ แต่บน Linux โฮสที่เช่าอยู่ทำไม่ได้ครับ

  2. #2
    Jedi Global Moderator Gen0TypE's Avatar
    Join Date
    Jan 2008
    Location
    Khonkaen
    Posts
    312


    ติด permission รึป่าวครับ

  3. #3
    Member
    Join Date
    Jul 2009
    Location
    Dindaeng
    Posts
    51


    ติด permission รึป่าวครับ
    [/b]

    อันนี้ไม่ทราบนะคับ

    แต่ผมคิดว่าน่าจะเป็นที่การตั้งค่าที่ php.ini อ่ะครับ

    แต่ไม่รู้ว่าบรรทัดไหนน่ะครับ

    พอจะทราบไหมครับ

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Location
    ดาวนาเม็ก
    Posts
    5


    อาจจะเป็นที่ base directory ครับ เบื้องต้น ให้ลองเช็ค Permission folder และ ไฟล์ก่อน ถ้าหากยืนยันว่า สามารถ Execution ได้ ให้ลองเช็คจาก error log น่าจะให้รายละเอียดได้บ้างว่าทำไม include ไม่ได้

    สุดท้าย ลอง phpinfo(); ดูครับ บางทีอาจจะติดเรื่อง security ที่ห้าม execute นอก directory.

    ส่วนใน PHP.INI ลองดูที่บรรทัดนี้
    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below. This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    ; http://php.net/open-basedir
    ;open_basedir =

Similar Threads

  1. #include algoritm.h
    By um007 in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 0
    Last Post: 03-11-2009, 05:23 PM
  2. #include "stdio.h" ต่างกับ #include "stdafx.h" ยังไงครับ
    By ossytong in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 6
    Last Post: 23-09-2009, 02:28 PM
  3. PHP include() กะ require() ต่างยังไง
    By KiAk in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 3
    Last Post: 10-01-2009, 04:56 AM
  4. All about tool include underground and foreground
    By snapter in forum Hacking Links & Resources
    Replies: 0
    Last Post: 14-01-2008, 11:28 PM
  5. PDF to Word Converter 2.0 include serial
    By babuubabuu in forum Window Application
    Replies: 0
    Last Post: 11-01-2008, 09:11 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •