Is fopen() forbidden in WP?

File system access is tricky thing between different possible server configurations. If you need to implement it reliably in WP you should look into its API for such.

See Using the WP_Filesystem.