Thanks! So I made a tiny PHP wrapper to my CGI script, and includeme-ing that.
Now to figure out why the php conflicts with mod_pagespeed… Weirdly, exec(“who”) was fine, but exec(“my script”) gets a whole complicated wrapper and a redirect in Javacript. (No rest for the weary.)
Thanks again!