Re: [Catalyst] mod_fcgid on win32

2010-03-10 Thread Alan Hicks



fREW Schmidt wrote:

Ok, so I may be getting somewhere with this, but I can't tell.

I installed the .dll found here: http://www.fastcgi.com/dist/ and now my 
config looks like the following:


VirtualHost *:8080
   DocumentRoot C:/aircraft_ducting/root/
   Alias /static C:/aircraft_ducting/root/static
   FastCgiServer C:/aircraft_ducting/script/acd_fastcgi.fcgi -processes 3

   #Alias / C:/aircraft_ducting/script/acd_fastcgi.fcgi
   Alias / C:/aircraft_ducting/script/acd_fastcgi.fcgi/
   Location /static
  SetOutputFilter DEFLATE
  SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
  SetHandler default-handler
   /Location
/VirtualHost

When I run the fastcgi script manually from the commandline it prints 
out our root page, which seems like a good sign.


Yet when I go to host:8080 I get a 500 and the following is printed in 
the logs:


[Thu Jan 28 21:10:07 2010] [warn] FastCGI: server 
C:/aircraft_ducting/script/acd_fastcgi.fcgi (pid 788) terminated with 
exit with status '0'
[Thu Jan 28 21:10:07 2010] [warn] FastCGI: server 
C:/aircraft_ducting/script/acd_fastcgi.fcgi restarted (pid 944)
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$ENV{REMOTE_ADDR} in string ne at 
C:/usr/site/lib/Catalyst/Engine/CGI.pm line 61.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$ENV{SERVER_PORT} in numeric eq (==) at 
C:/usr/site/lib/Catalyst/Engine/CGI.pm line 85.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$host in pattern match (m//) at C:/usr/site/lib/Catalyst/Engine/CGI.pm 
line 136.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$host in substitution (s///) at C:/usr/site/lib/Catalyst/Engine/CGI.pm 
line 185.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$host in concatenation (.) or string at 
C:/usr/site/lib/Catalyst/Engine/CGI.pm line 196.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
$host in concatenation (.) or string at 
C:/usr/site/lib/Catalyst/Engine/CGI.pm line 204.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
in string eq at C:/usr/site/lib/Catalyst/Action/RenderView.pm line 52.
[Thu Jan 28 21:10:12 2010] acd_fastcgi.fcgi: Use of uninitialized value 
in string eq at C:/usr/site/lib/Catalyst.pm line 1714.


Any ideas on what I might try next?


Not sure if this is still an issue but I'm getting the same 
uninitialized error, tracked it down to using either of the plugins 
FormValidator or FormValidator::Simple.  As I don't know enough about 
the plugins, no one else appears to be having this issue, and prefer the 
nicer FormFu I'm currently refactoring to that instead, initial results 
are good.


Alan



--
fREW Schmidt
http://blog.afoolishmanifesto.com




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Use of uri_for with CaptureArgs

2008-02-04 Thread Alan Hicks

Hi,

I've started using CaptureArgs and PathPart and find them excellent and 
easy to use.


I've probably missed something from the docs but does anyone have a best 
practice in using uri_for or an alternative for generating url's? the 
case I'm having difficulty with is to generate a url with more than one 
id such as /artist/*/images/*  An example might demonstrate what I'm 
trying to achieve:


MyApp::Controller::Artist
sub artist_setup : Chained('/') : PathPart('artist') : CaptureArgs(1)  {}
/artist/*

From within MyApp::Controller::Artist uri_for($id, 'show') does the 
right thing and produces http://localhost/artist/*/show


MyApp::Controller::Artist::Images
sub images_setup : Chained('/artist/artist_setup') PathPart('images') 
CaptureArgs(1)  {}

/artist/*/images/*

From within MyApp::Controller::Artist::Images uri_for($id, 'show') 
gives http://localhost/artist/images/*/show which does not take into 
account the artist id so do I have to build uri_for('/artist', 
$artist_id, 'images', $id, 'show') which appears cumbersome.


Any suggestions appreciated,
Alan


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Use of uri_for with CaptureArgs

2008-02-04 Thread Alan Hicks

Bogdan Lucaciu wrote:

On Monday 04 February 2008 14:09:25 Alan Hicks wrote:

MyApp::Controller::Artist::Images
sub images_setup : Chained('/artist/artist_setup') PathPart('images')
CaptureArgs(1)  {}
/artist/*/images/*

 From within MyApp::Controller::Artist::Images uri_for($id, 'show')
gives http://localhost/artist/images/*/show which does not take into
account the artist id so do I have to build uri_for('/artist',
$artist_id, 'images', $id, 'show') which appears cumbersome.


From the documentation of uri_for (perldoc Catalyst): 
$c-uri_for( $path, @args?, \%query_values? )


If the first element of @args is an arrayref it is treated as a list of 
captures to be passed to uri_for_action


I would do: 
$c-uri_for( $c-controller('Artist::Images').action_for('show') , 
[$artist_id, $image_id]);


this can be shortened by writing an action_uri sub in MyApp.pm: 
$c-action_uri( qw/Artist::Images show/, [$artist_id, $image_id]);


You can read more about uri_for in the calendar article:
http://catalyst.perl.org/calendar/2007/13



Thanks,
Thought I'd missed something obvious.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/