mojo
mojo copied to clipboard
Unknown command "cgi", maybe you need to install it?
- 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?
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.
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?
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
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.
It sounds like pp is not including dynamically loaded modules. You might have to tell it to include those specifically