The reason WordPress fails to recognize themes is that the server environment has disabled the scandir function, preventing WordPress from properly caching themes.
How to fix the theme recognition issue under LNMP:
- Locate
php.ini— it’s typically found in the/usr/local/php/etcdirectory on the server. - Open
php.ini, search for “disable_functions”, find and remove “scandir” from the list that follows, then save the file. - Restart the PHP service on your server for the changes to take effect.