Notice: Use of undefined constant STDOUT - assumed 'STDOUT' Notice: Use of undefined constant STDOUT - assumed 'STDOUT' php php

Notice: Use of undefined constant STDOUT - assumed 'STDOUT'


The problem, in this case, is that the constant STDOUT is not defined. It is a constant available when using the command line, so in order to use them in other settings you can do this:

if(!defined('STDIN'))  define('STDIN',  fopen('php://stdin',  'rb'));if(!defined('STDOUT')) define('STDOUT', fopen('php://stdout', 'wb'));if(!defined('STDERR')) define('STDERR', fopen('php://stderr', 'wb'));

This will check whether or not the constant has been defined, and if not, define them according to how they are expected to work.

More information about the constants can be found here in the PHP docs.


You should add, in your own code, something like :

define("STDOUT", fopen('log.txt', 'w'));

Information about files transfered will be logged into the file 'log.txt'.