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

Rob Thompson's Blog:
PHP and Solaris - getcwd() Behavior
Nov 12, 2007 @ 19:47:00

Rob Thompson passed along some information that PHP users running on Solaris might want to check out - the slightly buggy behavior of the PHP getcwd function on the platform.

Many functions within the PHP codebase relied upon a universally working getcwd() [C] call to expand paths and to find out where a script is being executed. In particular, Solaris does not assume that getcwd() is a privilege that should be granted to users in directories that don't have 'r' (read) permission, even if it has 'x' (execute) permissions. [...] Under Linux, getcwd() behaves normally but under Solaris, getcwd() does not work with the --x restrictive permissions.

He does note, happily, that this issue is cleared up with an upgrade to PHP 5.2.5 as soon as possible. He had code snippets included in the post so you can test your installation for the problem too.

tagged: solaris getcwd behavoir update php5 permissions solaris getcwd behavoir update php5 permissions

Link:

Rob Thompson's Blog:
PHP and Solaris - getcwd() Behavior
Nov 12, 2007 @ 19:47:00

Rob Thompson passed along some information that PHP users running on Solaris might want to check out - the slightly buggy behavior of the PHP getcwd function on the platform.

Many functions within the PHP codebase relied upon a universally working getcwd() [C] call to expand paths and to find out where a script is being executed. In particular, Solaris does not assume that getcwd() is a privilege that should be granted to users in directories that don't have 'r' (read) permission, even if it has 'x' (execute) permissions. [...] Under Linux, getcwd() behaves normally but under Solaris, getcwd() does not work with the --x restrictive permissions.

He does note, happily, that this issue is cleared up with an upgrade to PHP 5.2.5 as soon as possible. He had code snippets included in the post so you can test your installation for the problem too.

tagged: solaris getcwd behavoir update php5 permissions solaris getcwd behavoir update php5 permissions

Link:

IBM developerWorks Blog:
What's the problem? (Working Directories)
May 17, 2006 @ 10: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.

tagged: current working directory windows getcwd current working directory windows getcwd

Link:

IBM developerWorks Blog:
What's the problem? (Working Directories)
May 17, 2006 @ 10: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.

tagged: current working directory windows getcwd current working directory windows getcwd

Link:


Trending Topics: