1

Topic: Checking if fopen is enabled

Is there any check that can be made by a script to see if fopen is enabled on the server?


Cheers,

Matt

Re: Checking if fopen is enabled

Are you talking about allow_url_fopen, or the actual fopen function (which is much rarer)

3

Re: Checking if fopen is enabled

The fopen function. It's one that I use in the download mod to check if a ftp server is accepting connections. Would I need to make it manually enabled/disabled within the script, or could I check via the script itself if fopen will work?

Re: Checking if fopen is enabled

Why use fopen instead of the standard FTP functions?
http://be.php.net/manual/en/ref.ftp.php

Re: Checking if fopen is enabled

if (function_exists('fopen'))
   // bla bla

Hosts completely disabling fopen() is quite rare though. They generally just disable allow_url_fopen.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6

Re: Checking if fopen is enabled

Rickard wrote:

if (function_exists('fopen'))
   // bla bla

Hosts completely disabling fopen() is quite rare though. They generally just disable allow_url_fopen.

If fopen is enabled, but allow_url_fopen is disabled, will that enable the fopen function to access local files but not (remote/external to filesystem) files? If so, I've cocked up on my above question. big_smile It's the ability for fopen to connect to an external uri which I was wishing to check for. smile

My apologies if I have mis-phrased my question. big_smile


Many thanks again,

Matt

Re: Checking if fopen is enabled

Matt: Correct. You're looking for allow_url_fopen. Check admin_index.php, PunBB detects it smile

8

Re: Checking if fopen is enabled

Cheers. smile Thanks again. smile