You are not logged in.
Hi there. I really a need solution with the Office-Support for oneye. Everything is up and running smoothly but the only problem is Office (enable Office-Support). I even tried to use an Windows Sever with OpenOffice 4 and it still the same error.
Debian 7.1.0
Xampp/Lampp PHP 5.4
LibreOffice 3
Last edited by rozondas (2013-07-31 16:53:28)
Offline
I'am using oneye 0.9.1 (before 0.9.0).
Copy
youroneyeDir/oneye_xxxxxx/extras/OpenOffice/oneye.xba
from the oneye installation directory to
/usr/lib/openoffice/share/basic/Tools/
Edit
/usr/lib/openoffice/share/basic/Tools/script.xlb
and add
library:element library:name="eyeOS"/
under
library:element library:name="Debug"/
:should look like this
library:element library:name="Debug"/
library:element library:name="eyeOS"/
Offline
Hi rozondas,
The steps you followed are no longer valid (where did you get them from?) - the eyeos.xba route has been completely removed in favour of unoconv. (Lars, maybe we should remove the [SYSTEM]/extras/OpenOffice folder?)
Could you please:
In your browser, login to your oneye installation
Right-click on the desktop area and select 'Preferences'
From the categories down the left-hand side, select 'System'
From the tabs at the top, select 'Office Support'
Then follow its instructions:
If it can't find python, then enter the correct path (and press 'Save').
If it tells you that you need to install unoconv, grab this: https://github.com/s0600204/unoconv/archive/master.zip and extract it to system****/extras/unoconv
To refresh the settings page in oneye to see changes, reselect 'System' then 'Office Support'.
Hope this helps
Offline
@rozondas: s0600204 is all right.
The steps you followed are no longer valid (where did you get them from?) - the eyeos.xba route has been completely removed in favour of unoconv. (Lars, maybe we should remove the [SYSTEM]/extras/OpenOffice folder?)
Ouch, I thought that's been removed already. Done so finally.
@s0600204: Are your changes to unoconv good enough to start a pull request for them? Would like to benefit from other contributions (no explicit one for the moment) to that project, too.
Best regards,
Lars Knickrehm
The oneye project.
Offline
@s0600204:
Python path is set. I'am still unable to open .doc files. Same error es before: For some reason the conversion failed. Try again Later.
Python 2.7.3
Offline
@rozondas
And unoconv? Is that installed? For clarity, extracting the zip I linked will give you a folder called 'unoconv-master'. The contents of this folder want to go into system****/extras/unoconv, and must be able to be read from and written to by the webserver.
Offline
@s0600204:
Still not working, even with the new unoconv files. Still getting the For some reason the conversion failed. Try again Later error
Offline
Okay, please, add "var_dump($cmd);" the following line to the file "xxxxxxxxxx/system/lib/eyeConverter/main.eyecode" in front of "shell_exec($cmd);":
Now you should see some kind of log message before that "For some reason [...]" line, correct? Please, post that line here and I'll give you further instructions.
Just a small description of what that line's doing and what I've in mind: That line prints out the command, which we use to start unoconv, a script/tool to convert documents using LibreOffice. With some kind of preparation (second step, that I need your command for) you can try calling that command inside your shell in order to receive some more Feedback from unoconv.
Best regards,
Lars Knickrehm
The oneye project.
Offline
string(318) "'python' '/opt/lampp/htdocs/oneye/system_1152573eed/extras/unoconv/unoconv' --format=html --output='/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp/71764_new.tmp' --home='/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp' '/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp/71764.doc'"
Offline
Okay, so please try the following in a shell on that server:
1) The following should some help for unoconv. Does it?
'python' '/opt/lampp/htdocs/oneye/system_1152573eed/extras/unoconv/unoconv' --help
2) Take a valid doc file, rename it to "test.doc" and save it somewhere. Go there (in command line) and try the following. What does it create? Is there a file or Folder
'python' '/opt/lampp/htdocs/oneye/system_1152573eed/extras/unoconv/unoconv' --format=html --output='./test.html' './test.doc'
Well, if those tests fail already, it seems to be a Problem with the python path or something like that.
PS, @s0600402: On Windows LibreOffice comes with its own python at "C:\Program Files (x86)\LibreOffice 4.0\program\python.exe". What about the UNIX versions?
Best regards,
Lars Knickrehm
The oneye project.
Offline
@lars-sh:
The test worked. A .html was created with the text from the .doc file. Now what?
Offline
Well, unoconv and LibreOffice seem to be installed correctly and those path seem to be correct, too.
We can now check what happens if we clean HOME and PATH variables before calling unoconv. But I guess that's working just fine, so it seem to be a rights problem when calling python via PHP. I'm in train right now. In the evening I'll create a simple test file for you to check what happens when calling "shell_exec" (a PHP function).
In the meanwhile you might check if that function is in the list of PHP's disabled functions (see PHP.ini).
Best regards,
Lars Knickrehm
The oneye project.
Offline
I'am unable to open the php.ini. Even with Gedit
Offline
@lars : It varies from system to system, I believe. On systems that have package managers that understand the concept of dependencies, then the correct version should be pulled automatically. As rozondas is running Debian, which does have such a package manager, then the correct python version should be installed. This is easily confirmed by the fact that I too have a Debian system and that his python version matches mine.
@rozondas : Could you please go to the file "xxxxxxxxxx/system/lib/eyeConverter/main.eyecode", find this line (should be 80)
$args = ' --format=' . $format . ' --output=' . escapeshellarg($dest) . ' --home=' . escapeshellarg(realpath(um('getCurrentUserDir') . TMP_USER_DIR)) . $args;
and add
. ' -vvvvvv > ../unoconv.log'
to the end before the semicolon so it reads
$args = ' --format=' . $format . ' --output=' . escapeshellarg($dest) . ' --home=' . escapeshellarg(realpath(um('getCurrentUserDir') . TMP_USER_DIR)) . $args . ' -vvvvvv > ../unoconv.log';
Then, rerun the conversion and report back whatever "unoconv.log" has within it.
Offline
@s0600204: Added your code and made a test conversion. The unoconv.log is empty O.o
Offline
Just to let you know: I won't be able to answer before Saturday, cause of some mandatory work. Will keep this thread in mind.
PS: But that file is created once you open a document? I recommend you to do something like the following in that line (additionally) and post the output here:
var_dump(shell_exec(...));
Best regards,
Lars Knickrehm
The oneye project.
Offline
Back again after my vacation.
The unoconv.log is created after I start the conversion. Were exactly shall I put the var_dump(shell_exec(...)); code?
Offline
Sorry, has been busy that day, here's a better description of what to do:
Edit "system/lib/eyeConverter/main.eyecode" and replace shell_exec($cmd); with var_dump(shell_exec($cmd));.
Finally tell us what you see in that eyeVisor window (when opening a DOC / ODT file).
PS: Just to make sure you might want to send me a screenshot of that to mail@lars-sh.de .
Best regards,
Lars Knickrehm
The oneye project.
Offline
string(343) "'python' '/opt/lampp/htdocs/oneye/system_1152573eed/extras/unoconv/unoconv' --format=html --output='/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp/64734_new.tmp' --home='/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp' -vvvvvv > ../unoconv.log '/opt/lampp/htdocs/oneye/system_1152573eed/users/rt4/root/tmp/64734.doc'" NULL
For some reason the conversion failed. Please try again later.
You got an E-Mail
Offline
Got it, thanks. Strange results I'm really not sure why we get "NULL" from that shell_exec call. It should have been something... more/different... at least *something* xD
Please, create a new php file and add the following php code ( http://pastebin.com/m7FxY7Fy ) into it, save, upload and then call that php file within your browser. Finally show us (again) what's shown.
Some explanation: The script executes the simple shell command "echo" and it tries to start python. Le's hope we get some results out of that...
Best regards,
Lars Knickrehm
The oneye project.
Offline
Suggested small alteration to 3rd line of the pastebin (Careful of the " and '):
var_dump(shell_exec("'python' -c 'print \"abc\"'"));
Calling 'python' without any arguments will cause it to return without doing or outputting anything.
Oh, and if you're using var_dump(), remove the "> ../unoconv.log" from my earlier suggestion, but leave the "-vvvvvv" in place (for now).
Offline
Here the results.
Code from lars-sh: string(4) "abc " NULL
Code from s0600204: string(4) "abc " string(4) "abc "
Last edited by rozondas (2013-08-30 15:57:26)
Offline
Oh, and if you're using var_dump(), remove the "> ../unoconv.log" from my earlier suggestion, but leave the "-vvvvvv" in place (for now).
Just made sure, that the pipe is working correctly.
Best regards,
Lars Knickrehm
The oneye project.
Offline
Summary
"shell_exec" works with both, "echo" and "python".
When doing the conversion, its output is simply nothing.
With a shell user conversation works just fine.
My next idea
As stated previously, I guess that there's some kind of problem with the permissions. Please, remove those two lines from either mine or s06's file and add the following one:
var_dump(shell_exec("'python' '/opt/lampp/htdocs/oneye/system_1152573eed/extras/unoconv/unoconv' --help"));
Best regards,
Lars Knickrehm
The oneye project.
Offline