ubuntu 14.04 - Issue with using wildcards in php glob() -
i have strange situation happening php glob() , wondered if has encountered it. problem may broad here, trying anyway.
i'm running following:
distributor id: ubuntu description: ubuntu 14.04.4 lts release: 14.04 codename: trusty php 5.6.20-1+deb.sury.org~trusty+1 (cli) copyright (c) 1997-2016 php group zend engine v2.6.0, copyright (c) 1998-2016 zend technologies zend opcache v7.0.6-dev, copyright (c) 1999-2016, zend technologies xdebug v2.3.3, copyright (c) 2002-2015, derick rethans
my glob function working before using:
$images = glob($path . '/' . $id .'.*');
then stopped working. i've not changed on server or in other code. these different things i've tried see happen
$images = glob($path . '/' . $id . '.{jpg,jpeg,png,gif}', glob_brace); //works $images = glob($path . '/*.jpg'); // doesn't work $images = glob($path . '/*'); // doesn't work
basically, anytime use wildcard, no matter position, script (ran command line) sits there. no error, no return, nothing. tried using globiterator same results.
i've tried uninstalling , reinstalling php, created new directory temp files perform tests, , nothing seems working again. there 1000 files in directory, should take long match (i've let sit hour).
so, wondering if has run problem before or perhaps know of solution? out of curiosity because i've rewritten code not using glob() in places required wildcard.
update 2 it's doing again. hanging when using wildcard. ran below tests:
// not working var_dump(glob('/vagrant/biospex-2.0/storage/scratch/1-8c6b410c42da62d37e7aabc00a61e258/*')); // not working var_dump(glob('/vagrant/biospex-2.0/storage/scratch/1-8c6b410c42da62d37e7aabc00a61e258/*.jpg')); // not working var_dump(glob('/vagrant/biospex-2.0/storage/scratch/1-8c6b410c42da62d37e7aabc00a61e258/*.{jpg,jpeg,gif,png,tif,tiff}', glob_brace)); // not working var_dump(glob('/vagrant/biospex-2.0/storage/scratch/1-8c6b410c42da62d37e7aabc00a61e258/5715116ac46988ff1a8b4b8f.*')); // working var_dump(glob('/vagrant/biospex-2.0/storage/scratch/1-8c6b410c42da62d37e7aabc00a61e258/5715116ac46988ff1a8b4b8f.jpg'));
update 3 in directory there 1100 images. found when cut number down 712, glob returns array. adding 1 more image, total of 713, makes hang. difference in size between 2 1.62gb , 1.63gb respectively. tried changing php settings had no effect. added small txt file directory , still hung up. not sure happening here. should mention using ubuntu on virtualbox hosted on windows machine shared folders. now, i'm going use iterator.
not solution ended rebuilding local dev server scratch. glob() function started working after that. so, must have happened mess things up.
Comments
Post a Comment