Open the database schema, then delete all contents of menu_links and menu_router tables with the following SQL queries:
DELETE FROM menu_links;
DELETE FROM menu_router;
Then run http://example.com/update.php. It will call menu_rebuild(), which will populate these tables with 'fresh' data. It worked for me after a "PHP Fatal Error: Out of memory" turned some of my menus into a mess.
But be aware, that it will wipe out all you custom menus which you will have to rebuild manually. To avoid it you may play a bit with deleting of some selected records from
menu_router and menu_links, but for me it didn't work well.
And don't forget to back-up your database and site directory before deleting contents from the tables.
/var/www/htdocs/drupalAnd modifying it is a bad idea. Could you please add more details as to why you want to call menu_rebuild ?