I\'ve imported 6K categories and 16K products to magento using a custom import profile. When I\'m trying to reindex everything works except for \'Catalog URL Rewrites\' that kee
I was encountering the same problem, the server that I am running this on is a FreeBSD server. With the help of the sample of the above code I was able to get the issue to resolve buy running the following command in the shell.
/usr/local/bin/php /usr/local/www/magento/shell/indexer.php --reindex catalog_url
It runs very quickly and resolved my issue. I then created a cron for this to run every 6 hours on my server.