Manual:PopulateCategory.php

This script populates the Category table. This table keeps track of how many articles, files and subcategories are in a category. It is also used for displaying information on Special:Categories. This script is automatically run by update.php if updating from before MediaWiki 1.13.

If you have incorrect counts of how many articles are in a category, you can run this script with the  option to regenerate category statistics.