A user Shu-I Huang has reported a problem with modpythonhandler.py and
proposed the following fix:

       if 'SCRIPT_NAME' in options:
           # Override SCRIPT_NAME and PATH_INFO if requested.
           env['SCRIPT_NAME'] = options['SCRIPT_NAME']
           req.uri = env['SCRIPT_NAME']    # <<<<<< EDD THIS LINE
           env['PATH_INFO'] = req.uri[len(options['SCRIPT_NAME']):]

I am convinced this fix is a god solution because I am not sure what
happens to get variables. I am also not sure why the problem exists.
Anyway, perhaps this may help you.

On May 12, 11:58 am, Mauricio Darocha <mauriciodaro...@gmail.com>
wrote:
> Hi Alvaro. Thank you for your prompt answer, but I'm still having issues
> with it.
>
> I don't have access to any configuration file. So I'm using .htaccess.
>
> .htaccess =
> SetHandler python-program
> PythonHandler web2py_modpython
> PythonDebug Off
> PythonPath "['/home/mauricio/public_html/'] + sys.path"
>
> web2py_modpython.py =
> from mod_python import apache
> import modpythonhandler
>
> def handler(req):
>     req.subprocess_env['PATH_INFO'] = '/home/mauricio/public_html/'
>     return modpythonhandler.handler(req)
>
> I'll get very sad if I can't use web2py in my host. Any help is greatly
> appreciated.
>
> Thank you.
>
> Mauricio.
>
> On Wed, May 12, 2010 at 1:50 PM, Álvaro Justen <alv...@justen.eng.br> wrote:
> > On Wed, May 12, 2010 at 13:23, Mauricio <mauriciodaro...@gmail.com> wrote:
> > > Hi Everyone!
>
> > > First of all, I would like to congratulate Massimo Di Pierro. If you
> > > can read this, you are the man! I loved web2py.
>
> > > Unfortunately, I'm a beginner from Brazil and I'm having a hard time
> > > to set it up in a shared host.
>
> > > If someone can help me out, I greatly appreciate.
>
> > > I made some research myself before bother anybody with this.
>
> > > Since I don't have access to http.conf file or any other configuration
> > > file, I followed the steps in the manual.
> > >http://web2py.com/book/default/section/11/8
>
> > > But mod_python gives me an error on SCRIPT_URL.
>
> > > So, I put the path '/home/myfolderwithweb2py' to
> > > req.subprocess_env['SCRIPT_URL'], instead.
>
> > > But now, I've got the message "Invalid request", nothing else. Not
> > > even if I change "PythonDebug On" on .htaccess.
>
> > > Can anybody help me out?
>
> > > Thank you in advance.
>
> > > My host ishttp://mochahost.com/webhosting.php
> > > Linux / Apache 2
> > > Python 2.5
> > > mod_python
>
> > Hi Mauricio,
> > I've answered yout question in web2py-users-brazil mail list.
>
> > --
> > Álvaro Justen - Turicas
> >  http://blog.justen.eng.br/
> >  21 9898-0141

Reply via email to