I spent an hour trying to figure out why, despite following numerous instructions and troubleshooting steps, that this would not work.
Some setup details:
OS – Windows 7
Server – Xampp’s portable lamp stack
The core WordPress files are all in Xampp’s C:\xampp\htdocs while the theme and one of the plug-ins is being symbolically linked into the web server directory. This is because I have all of my code that is under Git control in one place, and I just symbolically link it into wherever I need it to run.
Initially I thought it was because I was using Windows. I even found a bug ticket from 5 years ago saying register_activation_hook doesn’t work on Windows because of path separators. That ticket had long been in the fixed state though and I didn’t see any more recent ones.
I did some quick debug echos of where php thought everything was located and sure enough, because it is symbolically linked into the wp-content/plugins folder, it was interpreting the plug-ins existence as being in the Git folder and not the server folder under all of the rest of the WP stack.
Some piece of this (still under investigation), made it impossible for the register_activation_hook to fire. It has to be isolated to the register_activation_hook function in the wp-includes/plugin.php file. As soon as I made it activate on the init action, everything worked. As well as, installing this plug-in on a linux server without using symbolic links, the register_activation_hook worked.