Magento 1.9验证码图像未生成

I'm on Magento 1.9 and currently facing an issue with the captcha on admin login page. Captcha image is not getting generated and it shows broken link in place of captcha image.

I also checked webroot/media/captcha/admin and webroot/media/captcha/base it is empty.

Can someone help me? How to go about troubleshooting this issue?

Check whether write permission is there for both these folders webroot/media/captcha/admin and webroot/media/captcha/base. So that the captcha image files can be created inside these folders.