This forum has been archived. All content is frozen. Please use KDE Discuss instead.

web plugin: ktorrent dies on login

Tags: None
(comma "," separated)
dierbro
Registered Member
Posts
36
Karma
0

Thu Dec 21, 2006 5:17 pm
Load logviewer plugin, try to login from web interface and then paste log here.

thanks
imported4-Colin
Registered Member
Posts
33
Karma
0

Thu Dec 21, 2006 5:49 pm
Code: Select all
[...]
connection from 127.0.0.1
request from 127.0.0.1: /redirect.html?username=colin&password=asdf&Login=Submit+Query
Request key [username] value [colin]
Request key [password] value [asdf]
Request key [Login] value [Submit+Query]
Session valid
127.0.0.1 logged in
exec Login
exec username
connection_closed
connection from 127.0.0.1
request from 127.0.0.1: /interface.php
gone wrong
connection from 127.0.0.1
request from 127.0.0.1: /ktorrentwebinterfacelogo.png
Session valid
connection_closed
[...]


HTH
dierbro
Registered Member
Posts
36
Karma
0

Thu Dec 21, 2006 7:56 pm
please clear browser private data (coockies and autenticated session) and then try to login.
imported4-Colin
Registered Member
Posts
33
Karma
0

Thu Dec 21, 2006 10:25 pm
I cleared the cookies and authenticated sessions, but it is still not working. I am also getting the php endless wait whatever problem again:
Code: Select all
connection from 127.0.0.1
request from 127.0.0.1: /redirect.html?username=colin&password=asdf&Login=Submit+Query
Request key [username] value [colin]
Request key [password] value [asdf]
Request key [Login] value [Submit+Query]
127.0.0.1 logged in
exec Login
exec username
connection_closed
connection from 127.0.0.1
request from 127.0.0.1: /interface.php
Session valid
PHP executable error

The last line is when I kill php in terminal.
dierbro
Registered Member
Posts
36
Karma
0

Fri Dec 22, 2006 3:27 pm
How many torrent do you have?
Have you tried to login without loaded torrent?
imported4-Colin
Registered Member
Posts
33
Karma
0

Fri Dec 22, 2006 5:40 pm
OK, this time I am trying it on my laptop running Ubuntu (6.10), with no torrents loaded at all:

Code: Select all
connection from 127.0.0.1
request from 127.0.0.1: /
gone wrong
connection from 127.0.0.1
request from 127.0.0.1: /redirect.html?username=colin&password=asdf&Login=Submit+Query
Request key [username] value [colin]
Request key [password] value [asdf]
Request key [Login] value [Submit+Query]
Session expired
127.0.0.1 logged in
exec Login
exec username
connection_closed
connection from 127.0.0.1
request from 127.0.0.1: /interface.php
Session valid
PHP executable error
connection_closed

This time, no PHP timeout, just this error message in the browser:
Code: Select all
HTTP/1.1 Internal Server ErrorPHP executable error

Entering
Code: Select all
$ which php

doesn't return anything. I run "apt-get search php" and download the package php5, but that doesn't install a php executable anywhere.

Looks to me like
    a.) you need to test more aggressively for the presence of a php executable, and
    b.) you may not even be able rely on the presence of php on a given system.

Obviously these are a different set of problems than I was experiencing under FC6.
dierbro
Registered Member
Posts
36
Karma
0

Fri Dec 22, 2006 6:55 pm
I run "apt-get search php" and download the package php5, but that doesn't install a php executable anywhere.

maybe this thread can help you
http://ktorrent.org/forum/viewtopic.php?t=1125

a.) you need to test more aggressively for the presence of a php executable, and

in preference widget you can set php executable path
imported4-Colin
Registered Member
Posts
33
Karma
0

Fri Dec 22, 2006 11:42 pm
Ok, I have it working now under Ubuntu.

As for Fedora, where I normally run ktorrent, I have a couple dozen torrents active (seeds and downloads) and about the same number inactive, and I don't feel like going to all the trouble of removing and reloading them all at the moment, so I guess I will have to leave it be for the time being.

in preference widget you can set php executable path


Yes, but I didn't pay attention to that when I enabled the plugin. Why should I have concerned myself with the php path? Sometimes you need to think like an end-user. Like for example with a first-time setup wizard or at least a dialog box warning the user that the plugin can't find the executable. You just have "/usr/bin/php" entered in the "php path" field by default, and it appears that is a questionable assumption.
George
Moderator
Posts
5421
Karma
1

Sun Dec 24, 2006 1:21 pm
I guess we can display in the pref page wether or not the PHP executable is OK (i.e. the file exists and it is executable)
imported4-Colin
Registered Member
Posts
33
Karma
0

Sun Dec 24, 2006 5:04 pm
Exactly. You can't just assume by default. that it is there.
dierbro
Registered Member
Posts
36
Karma
0

Tue Dec 26, 2006 9:22 am
hi
please apply this patch on ktorrent-2.1beta1 (without previous patch). Then try to login, save from browser the source of interface.php in a file and execute from shell
Code: Select all
cat file_with_interface_source | /usr/bin/php  #the same path that you have in webinterface preference



Patch (i have sent it to your email)
Code: Select all
diff -ur ktorrent-2.1beta1/plugins/webinterface/php_handler.cpp ktorrent-2.1beta1-b/plugins/webinterface/php_handler.cpp
--- ktorrent-2.1beta1/plugins/webinterface/php_handler.cpp   2006-11-21 20:08:42.000000000 +0100
+++ ktorrent-2.1beta1-b/plugins/webinterface/php_handler.cpp   2006-12-26 09:48:49.000000000 +0100
@@ -49,7 +49,8 @@
       if(!proc->start())
          return false;
    locked=true;
-   proc->writeToStdin(s);
+   output.append(s);
+   //proc->writeToStdin(s);
    proc->flushStdin();
    proc->closeStdin();
    while(proc->isRunning())


Exactly. You can't just assume by default. that it is there.

I have added a led to display if php executable is ok

Thanks
imported4-Ivan
Registered Member
Posts
819
Karma
0

Fri Dec 29, 2006 4:48 pm
Diego, what's the status of this issue? Are the patches applied in SVN?

I'm having a KT freeze when I try to login. Mobile UI works fine, but default is causing KT to freeze until I kill php. This started happening 3-4 SVN revisions ago.
dierbro
Registered Member
Posts
36
Karma
0

Fri Dec 29, 2006 5:07 pm
Hi ivan
previous patch is usefull to bypass php interpreter and see the php code generated by PhpHandler::preParse() in the browser. Please apply it and send me the resulting php code of interface.php.

I think that some torrent name or tracker status string with special character ( " \ &) breaks php code but this should be fixed in 616688 revision.

Diego


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]