CGI is an interface, not a language. The other interface is CLI “command line interface.” To say something is CGI means it is meant to be run in a CGI environment by a web server and acts a certain way. You can write CGI programs in C for example.
I imagine your “cgi script” is written in Perl. You can execute PHP code the same way. You need a shebang with the path to the PHP executable, execute permissions on the source file, and of course avoid using CGI-specific features. Also you can’t mix HTML within the source file IIRC.
openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7