Php cgi binaries, one copy per site

As a programmer, I hate the redundancy of using an actual copy of my php binary in each of my sites cgi-bin directory. Is there a way I can either have one cgi-bin directory for all the sites to share, or somehow use a symbolic link so that it just references the binary in my main bin dir?

I tried a symbolic link but it didn’t work. I know it’s not much disk space, but every time I upgrade or recompile with new options would mean copying that new file into all those locations. It’d be nice if I only had to do it once, or even not at all.

Use a hard link instead of a symbolic link. Works as long as you’re on the same filesystem.

You’re right that it works. So now if I recompile and it writes over that location, the others will update too right?

It’s my understanding that a hard link to a file is an actual pointer in the file system to the same data as the original. And that deleting either will not affect the other. But I’m not sure about overwriting. If I modified the hard link I just created, would it modify the original?

Also, not that this matters much at ~3.5 MB each, but does each hard link take up some of my quota? Or does it know that it’s all the same file and only charge me once?

D’oh - that’s true - I think you’d have to upgrade each one, so that might not help you out so much.

Make a little shell script. :slight_smile:

rm old binaries
make install
create new links

Do the whole upgrade with one command