PHP File Location

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahmurad
    New Member
    • Aug 2007
    • 19

    PHP File Location

    Dear Brothers,

    I am using a 'text file location' at my code to read the file contents- which is working fine in my local server. The web contents/php files and the specified txt file are at the same location at my own server.

    [CODE=php]$fc = file ('./sitedb.txt');[/CODE]

    Now I want to read the txt file from another ftp server (Exaple: ftp://10.10.10.100/File/sitedb.txt').

    For this purpose, I changed the code location as below:

    [CODE=php]$fc = file ('ftp://10.10.10.100/File/sitedb.txt');[/CODE]

    But Failed. I think I may try as wrong way.Please suggest me.

    I am waiting for your valued relpy.

    Thanks
    ahmurad
  • kkshansid
    New Member
    • Oct 2008
    • 232

    #2
    Originally posted by ahmurad
    Dear Brothers,

    I am using a 'text file location' at my code to read the file contents- which is working fine in my local server. The web contents/php files and the specified txt file are at the same location at my own server.

    [CODE=php]$fc = file ('./sitedb.txt');[/CODE]

    Now I want to read the txt file from another ftp server (Exaple: ftp://10.10.10.100/File/sitedb.txt').

    For this purpose, I changed the code location as below:

    [CODE=php]$fc = file ('ftp://10.10.10.100/File/sitedb.txt');[/CODE]

    But Failed. I think I may try as wrong way.Please suggest me.

    I am waiting for your valued relpy.

    Thanks
    ahmurad
    check for case sensivity in your path as some servers are case sensitive

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Originally posted by ahmurad
      But Failed. I think I may try as wrong way.Please suggest me.
      Hey.

      How exactly did it fail? Did you get any errors?

      My first guess would be that your server has allow_url_fopen disabled.
      This needs to be enabled to allow HTTP or FTP URIs in the file-system functions.

      You can check this by doing:
      [code=php]<?php
      echo "allow_url_fope n: " . (ini_get("allow _url_fopen") ? "ON" : "OFF");
      ?>[/code]
      If this says OFF, you need to edit your PHP config.
      If it says ON, there is something else going on.

      Comment

      Working...