My normal development platform for PHP is Linux. I use a Red hat server for my website, my company uses red hat and Fedora for production, and I have Ubuntu at home. I couldn't be happier. Unfortunately, I'm now required to spend a good deal of time working in PHP in Windows using WAMP.
I say this is unfortunate because I am continually finding things which Linux supports which Windows does not. Last year, it actually delayed a project when we realized that WAMP used an earlier version of PHP (this has been fixed by the port of 5.3 to Windows). Today, I just learned that checkdnsrr
is not ported to Windows, and the entire pcntl
library is unavailable.
So, my questions is this: Is there anywhere which tells me the current differences between Windows and Linux regarding PHP?
I'm not looking for idiosyncrasies, such as those found in the comments here (though those would be nice), but rather which functions will not be available under Windows which are available under Linux.
----------------------- EDIT -------------------------
There have been two comments/statments which say thatcheckdnsrr
exists in 5.3 under Windows. Technically, this is correct. PHP will not say that the function does not exist. I don't know if this is the case with all installs or just WAMP, but while yes, it may say that it works, the function does not work as it does in Linux.
--------------------- UPDATE ----------------------
It does not look like there is a good answer possible to this question, but I have found a workaround thanks to one of the suggestions below:
Place this on the production environment. REMEMBER TO FORCE SOME FORM OF SECURITY ON THIS.
<?php print_r( get_defined_functions() ); ?>
Then run this on the dev environment. it will output all of the functions which are exclusive to the local environment.
$root = file_get_contents( "<path to server>/available.php" );
$root = preg_replace( "/\[[0-9]{1,4}\]\s=>\s/", ( '' ), $root );
$tmp = '"internal" => array';
$root = explode( "\n", substr( $root, strpos( $root, $tmp ) + strlen( $tmp ) + 1 ) );
array_shift( $root );
array_shift( $root );
$internal = get_defined_functions();
$internal = $internal[ "internal" ];
function trim_array( array $root )
{
$nroot = array();
foreach( $root as $key=>$value )
{
$value = trim( $value );
if( !preg_match( "/^[a-zA-Z_]*[aeiouy]+[a-zA-Z0-9_]*$/", $value ) &&
!preg_match( "/^[a-zA-Z_]*(md5|crc|n12|str|sqrt|ch[a-z]?r|dl|tnt|ftp|png)[a-zA-Z_]*$/", $value ) )
{
//echo "\n $key ";
}
else
{
$nroot[] = $value;
}
}
return $nroot;
}
$root = trim_array( $root );
$internal = trim_array( $internal );
$diff = array_values( array_diff( $root, $internal ) );
foreach( $diff as $key => $fname )
{
if( in_array( $fname, $root ) )
{
echo "[$key] => $fname <= foreign server only";
}
else
{
echo "[$key] => $fname <= local";
}
echo "\n";
}