S3 stream wrapper directory listing. Script is failing without making it past this point. Cant find out why

76
January 01, 2020, at 12:50 PM

Trying to understand why my previously tested and working code is failing when trying to test in another dev location(virtual test machine to physical test machine). Using PHP stream wrapper library and AWS PHP SDK to do directory listing and move each file name into an array being modified. Code seems pretty straightforward, but can anyone clue me in to why it would be failing on me? Am I using an older version of PHP where this process might not work if new test location is running an older version? Am I missing something obvious right under my nose??

$S3 = 's3://';
$BUCKET = 'bdn-live-ads';
$sourcePath = $S3 . $BUCKET . '/LIVE_ADS/';
$adfiles = array();
if( $handle = opendir( $sourcePath ) ){ //opens stream handle to s3 bucket
        while( false !== ( $entry = readdir( $handle ) ) ){ //while it reads through directory successfully
        /**
         * fills $adfiles with (key)$entry => (value)'LIVE_ADS'
         * 'LIVE_ADS' is another key=>value pair:
         * (key)'LIVE_ADS'=>(value)<full_file_path>
         */
         $adfiles[$entry]['LIVE_ADS'] = $sourcePath . $entry; 
        }
}//$adfiles now contains ad data
READ ALSO
Is using &ldquo;not in&rdquo; faster than using &ldquo;in&rdquo; in Python3?

Is using “not in” faster than using “in” in Python3?

Let's say we're solving a simple word count problemThere's a list and we're trying to find the word count of each word occurring in the list

73
How do I downgrade my version of python from 3.7.5 to 3.6.5 on ubuntu

How do I downgrade my version of python from 3.7.5 to 3.6.5 on ubuntu

So currently, I have ubuntu 19And it comes by default with python 3

2448
Failing when inserting generated column of date or time type from a datetime/timstamp source

Failing when inserting generated column of date or time type from a datetime/timstamp source

A generated column is a column containing the result of an expression or function based on another fieldI want a simple date and time field derived from a datetime field, but to insert records I must adopt a workaround

107