So I've been doing some conditional test, and yet I am getting errors. Basically what I am trying to do is see if using CLI with ftp_
functions will work on a server.
My test:
if(ftp_exec($connect,'ls -l'))
$canuse = true;
else
$canuse = false;
But this does not work on my server as it is blocked. Is there a test I can do without getting these errors and ruining my JSON (this trial returns a block of json)
You can either turn off all of the error_reporting/display_error options, so the warnings/errors are suppressed, or you could try the OB system to catch the junk:
All of the ftp errors would get caught in the ob buffer, and then thrown away when you shut down the buffer at the conclusion of the ftp test.