Hi Luigi

On Sun, Jun 09, 2013 at 05:41:36PM +0200, Luigi D'Andrea wrote:
> Hi All,
> I'm trying to run my php scripts using monkey on Raspbian
> pi@raspberrypi /var/www $ uname -a
> Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l 
> GNU/Linux
> 
> 
> I installe dphp5-fpb issueing the following command:
> sudo apt-get install php5-cli php5-fpm php5-cgi php5-mysql
> 
> I installed monkey v1.2.1
>  ./configure 
> --enable-plugins=auth,cheetah,dirlisting,liana,liana_ssl,logger,mandril,palm,patas
> make
> 
> then I edited the conf/plugins.load file, and now my plugins.load file is as 
> follow:
> 
> 
> [PLUGINS]
>     Load /home/pi/Desktop/monkey-1.2.1/plugins/auth/monkey-auth.so
>     Load /home/pi/Desktop/monkey-1.2.1/plugins/cgi/monkey-cgi.so
>     Load /home/pi/Desktop/monkey-1.2.1/plugins/fastcgi/monkey-fastcgi.so
>     Load /home/pi/Desktop/monkey-1.2.1/plugins/liana/monkey-liana.so
>     Load /home/pi/Desktop/monkey-1.2.1/plugins/logger/monkey-logger.so
> 
> 
> then I edited the conf/plugins/fastcgi/fastcgi.conf file:
> 
> ## FastCGI proxy configuration.
> [FASTCGI_SERVER]
>       ServerName php5-fpm
>       ServerPath /var/run/php5-fpm.sock
>       MaxConnections 5
> 
> [FASTCGI_LOCATION]
>       LocationName php5_location
>       ServerNames php5-fpm
>       KeepAlive On
>       Match /*.php
> 
> Last I launch the monkey web server:
> /home/pi/Desktop/monkey-1.2.1/bin/monkey -D
> 
> 
> I can use my cgi scripts in the /home/pi/Desktop/monkey-1.2.1/htdocs/cgi-bin  
> directory, i can see all html in the htdocs directory but I cannot see any 
> php rendered file.
> Safari returns back 
> 
> Safari can’t open the page “http://192.168.2.7:2001/template.php”. The error 
> is: “The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 
> 303.)” (kCFErrorDomainCFNetwork:303)
> 
> 
> What am I doing wrong?
> 

I've tested this setup and there seems to be a plugin interaction issue
going on.
With this fastcgi configuration and the default cgi configuration, some
files will be served by fastcgi and some by cgi.
You must make sure that the cgi plugin does not handle .php files by
commenting one line in conf/plugins/cgi/cgi.conf.
It should look like this:

    # Execute PHP scripts through php-cgi interpreter:
    # Match /.*\.php /usr/bin/php-cgi application/x-httpd-php

With this change the setup works fine with wordpress on my raspberry.

If you've already made this change and it's still not working, the issue
may be due to how monkey and your php script uses HTTP headers.
Could you please perform the same request using curl -v in terminal and
post it's output here on the mailing list if that is the case?
This will hopefully give some additional insights.

$ curl -vs http://192.168.2.7:2001/template.php 2&>1 | tee output.txt

Additionally, are your php script publicly available somewhere so that I
may test them locally?

> 
> 
> 
> _______________________________________________
> Monkey mailing list
> [email protected]
> http://lists.monkey-project.com/listinfo/monkey

-- 
Sonny Karlsson
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to