You are here: Re: Accessing a file on a separate computer, not in the web directory « PHP Programming Language « IT news, forums, messages
Re: Accessing a file on a separate computer, not in the web directory

Posted by Gordon Burditt on 08/14/07 02:21

>Probably an incredibly simple answer, but I can't seem to phrase it so
>a search engine can understand it.
>
>I have a php script with a simple include:
>include("/include_this.php")
>
>I need to edit this so it accesses the file from another server. I
>have tried:
>include("http://192.168.1.1/include_this.php:)

Leaving aside the access problems, these mean something *VERY*
different. The first include means "take the contents of this file
and run it as PHP. The second include means *RUN* this file as
PHP, then take the *OUTPUT* and *RUN THAT* as PHP. These are
very, very different.

>But the file isn't in the web directory, which in this case is /usr/
>local/apache/htdocs. It is one level above the web directory. I don't

In which case what you are asking for seems to be a security violation.

>know how to reference /usr/local/apache/include_this.php on another
>linux server. I don't even know what the correct term or phrase would
>be for this. Any help will be greatly appreciated.

You can access remote files if there is a method to access them
remotely. You can't use HTTP since the file is outside the web
directory. Now, what other remote file protocols might be available?
FTP. NFS. Samba. Each has their own method of accessing remote
files. Each works only if the file is actually exported via that
method. Are any of these methods (or others for file export)
available and enabled on the server? If not, you don't access it
remotely.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация