I put my captcha images in a folder structure like:
/var/www/phptests/.fontres/a/image_0a487165_d1433be7373a6458.png /var/www/phptests/.fontres/a/image_0b4a38c8_1c2c65d54cb68177.png /var/www/phptests/.fontres/a/image_0ba57eab_6fed40aa0e103478.png /var/www/phptests/.fontres/b/image_16252f86_e48dd4877918dacd.png /var/www/phptests/.fontres/b/image_17441e00_447c609aa4c7430a.png /var/www/phptests/.fontres/b/image_17810a2c_ccd70f8b5f08c9a0.png
And I have this in LocalSettings.php
$wgCaptchaDirectory = "/var/www/phptests/.fontres";
$wgCaptchaDirectoryLevels = 1;
However the captcha is blank when viewed in a browser.
I noticed in the browser console http://sodium:8080/mediawiki-1.35.0-rc.3/index.php?title=Special:Captcha/image&wpCaptchaId=1326427092 gets a 404 response.
When I use a simple folder structure with $wgCaptchaDirectoryLevels = 0; everything works.