You are here: Re: Directory path issue « PHP Programming Language « IT news, forums, messages
Re: Directory path issue

Posted by Michael Fesser on 10/11/07 22:08

..oO(kanwal)

>I have one php application that uses server path like /var/www/
>direcory in queries and also while calling files etc, and uses
>__FILE__ to fetch the path.
>
>I have installed apache on Windows XP and when I try to runs the
>application locally, script results in C:\apache\htdocs\testapp
>\index.php and here application stops working.
>
>Can anybody suggest or give an idea how I can have the similar path
>while working locally.

I do something similar in my own framework. My init script uses __FILE__
to determine the current path and to define some constants based on
that. Since these scripts have to run on both Linux and Windows, I call
strtr() first to translate all '\' to '/', before I split __FILE__ into
its parts. Internally all my scripts work with the Unix-like directory
separators. PHP can handle that, even if it runs on a Windows box.

Micha

 

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

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