News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

IBM developerWorks Blog:
What's the problem? (Working Directories)
May 17, 2006 @ 05:59:28

On the IBM developerWorks blog today, there's this look at the differences between PHP and Windows when it comes to the working directory you're grabbing in your script.

I recently investigated the values of the PHP and Windows working directory for a variety of environments. My reason for doing so was that I could never quite understand how relative pathnames were resolved, and if you want to write code that will run, for example, both under Zend Studio, from the command line, and Apache, it matters. And it is not surprising that I never understood it either - every environment is different.

He ran five tests to show each of the environments that a PHP script might be running in and what two methods return - PHP's getcwd and Windows' getcwd in direct.h). There are some similarities between the output of the two, but there's enough difference to be worrysome for any programmer making scripts for both. He also gives a specific example of a situation he was in involving incorrect paths and libxml2 and the difficulties that were found there.

0 comments voice your opinion now!
current working directory windows getcwd current working directory windows getcwd


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Zend & Oracle - Current Status?

PeterGuy.com: How to install PHP 5.x on Windows Server 2003 with IIS 6

Stuart Herbert's Blog: Participating in the European WinPHP Challenge 2009

Alison Holloway's Blog: PHP 5.2.2 Setup on Windows

Secunia.com: CodeIgniter Weakness and Directory Traversal Vulnerability


Community Events





Don't see your event here?
Let us know!


introduction community tool release conference podcast language composer artisanfiles library framework interview version list symfony laravel series opinion security voicesoftheelephpant

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework