Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP File Location

Newbie
 
Join Date: Aug 2007
Location: Bangladesh
Posts: 18
#1: Oct 18 '09
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.

Expand|Select|Wrap|Line Numbers
  1. $fc = file ('./sitedb.txt');
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:

Expand|Select|Wrap|Line Numbers
  1. $fc = file ('ftp://10.10.10.100/File/sitedb.txt');
But Failed. I think I may try as wrong way.Please suggest me.

I am waiting for your valued relpy.

Thanks
ahmurad

Familiar Sight
 
Join Date: Oct 2008
Posts: 128
#2: Oct 18 '09

re: PHP File Location


Quote:

Originally Posted by ahmurad View Post

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.

Expand|Select|Wrap|Line Numbers
  1. $fc = file ('./sitedb.txt');
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:

Expand|Select|Wrap|Line Numbers
  1. $fc = file ('ftp://10.10.10.100/File/sitedb.txt');
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
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,759
#3: Oct 19 '09

re: PHP File Location


Quote:

Originally Posted by ahmurad View Post

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:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     echo "allow_url_fopen: " . (ini_get("allow_url_fopen") ? "ON" : "OFF");
  3. ?>
If this says OFF, you need to edit your PHP config.
If it says ON, there is something else going on.
Reply

Tags
file