Avoid using the --with-curlwrappers (EXPERIMENTAL: Use cURL for url streams) when configuring PHP (tested with 5.4.x) if you need to use functions like mkdir or is_dir with streams like ftp:// because the calls will fail without error or warning.