Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My unoconv works perfectly in terminal using www-data, but no pdf file when executed through php #139

Closed
simkimsia opened this issue May 25, 2013 · 2 comments
Labels

Comments

@simkimsia
Copy link
Contributor

I am using nginx as my web server.

My OS is ubuntu 12.10 running in virtualbox as a guest OS.

When I ssh into my ubuntu 12.10 guest OS, I can execute unconv perfectly.

When I run as a php script it fails.

Weirdly, when I run php -r "exec(...);" in terminal, it works as well.

I have tried being explicit about the UNO_PATH. No use. I have tried all the troubleshooting by other people. My php script always returns a sucess signal about executing the unoconv, but there is no pdf file.

I also have no error messages whatsoever, so this is a bit frustrating.

I wrote the following function in php

public static function convert($originFilePath, $outputDirPath, $toFormat)
{
    $command = 'echo $PATH & UNO_PATH=/usr/lib/libreoffice unoconv --format %s --output %s %s';
    $command = sprintf($command, $toFormat, $outputDirPath, $originFilePath);
    exec($command, $output, $result_var);

    return compact('output', 'result_var', 'outputDirPath', 'originFilePath', 'toFormat');
}

This is my result after execution:

2013-05-26 03:05:30 Error: Array
(
    [output] => Array
        (
            [0] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        )

    [result_var] => 1
    [outputDirPath] => /var/virtual/storyzer.com/cake-json/ltequotationapp/webroot/outputfiles/Excel/2
    [originFilePath] => /var/virtual/storyzer.com/cake-json/ltequotationapp/webroot/outputfiles/Excel/2/dsadas.xlsx
    [toFormat] => pdf
)

Please advise.

@simkimsia
Copy link
Contributor Author

moving to #87

@simkimsia
Copy link
Contributor Author

My issue is solved. See here #87 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants