mojo icon indicating copy to clipboard operation
mojo copied to clipboard

Unknown command "cgi", maybe you need to install it?

Open leandrocombr opened this issue 3 years ago • 5 comments

  • Mojolicious version: Mojolicious is up to date (9.21)
  • Perl version: (v5.34.0)
  • Operating system: CentOS Linux 7 (Core)

Steps to reproduce the behavior

pp -M Mojolicious::Plugin::* -o test.pl script.pl

Expected behavior

When running the script on the server it gives the following error: Unknown command "cgi", maybe you need to install it?

Actual behavior

LOG: Unknown command "cgi", maybe you need to install it?

leandrocombr avatar Oct 19 '21 21:10 leandrocombr

You normally need to pass a command to the script, whether it's help or get or daemon or something else. It's probably trying to run cgi due to something in your environment.

There's some context important to debugging this that pp is PAR Packer and so this isn't a standard mojolicious deployment.

Grinnz avatar Oct 19 '21 21:10 Grinnz

Rereading the problem, did you mean to specify that it is run by a CGI server and that's why it's attempting to run the cgi command?

Grinnz avatar Oct 19 '21 21:10 Grinnz

Rereading the problem, did you mean to specify that it is run by a CGI server and that's why it's attempting to run the cgi command?

I'm running via apache

leandrocombr avatar Oct 19 '21 21:10 leandrocombr

Are you using something like Mojolicious::Plugin::RenderCGI, which has a dependency on CGI? I've used pp a lot in the past but never for Mojolicious apps, and don't think I ever would. Generally speaking running pp with the -x option to determine additional runtime dependencies has worked out well for me. Combined with the logging (-L) and (-v) verbose options you should be able to track down what is going on. Failing that simply unzipping your exe will show you what pp has packed.

MartinMcGrath avatar Jan 07 '22 09:01 MartinMcGrath

It sounds like pp is not including dynamically loaded modules. You might have to tell it to include those specifically

jberger avatar Jan 07 '22 12:01 jberger