Reputation: 4128
I am trying to set up Bugzilla REST api (bzapi) but I've hit a roadblock. I'm setting it up as a FastCGI prosess in a virtualhost in apache. I can execute the script from /var/www/bzapi
by executing ./script/bugzilla_api_fastcgi.pl
, but not from /var/www/bzapi/script
using ./bugzilla_api_fastcgi.pl
as a I get the same error as in apache.
The apache error:
[Tue Mar 06 15:04:49 2012] [warn] FastCGI: server "/var/www/bzapi/script/bugzilla_api_fastcgi.pl" started (pid 13329)
Can't locate Bugzilla/API.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.1/Module/Runtime.pm line 317.
at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50
[Tue Mar 06 15:04:50 2012] [warn] FastCGI: server "/var/www/bzapi/script/bugzilla_api_fastcgi.pl" (pid 13329) terminated by calling exit with status '2'
The apache config:
FastCgiServer /var/www/bzapi/script/bugzilla_api_fastcgi.pl -processes 10 -idle-timeout 180
Alias /bzapi /var/www/bzapi/script/bugzilla_api_fastcgi.pl/
The script:
#!/usr/bin/env perl
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('Bugzilla::API', 'FastCGI');
1;
What's a clean way of solving this issue?
Upvotes: 0
Views: 669
Reputation: 5069
Add use lib lines to your script. Locate Api.pm file and add that line to your script. Maybe this works.
#!/usr/bin/env perl
use lib '/var/www/bzapi';
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('Bugzilla::API', 'FastCGI');
1;
Upvotes: 1