Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using ubuntu with libreOffice. I have installed unoconv for convert a *.odp file to *.pdf. When i run the command unoconv -f pdf myfile.odp from terminal then it works very fine. I want to do the same thing with using PHP shell_exec() method. So, I wrote the following code:

$output = shell_exec('unoconv -f pdf test.odp 2>&1');
echo $output;

But it shows the following error:

/usr/bin/python: /opt/lampp/lib/ no version information available (required by /usr/bin/python) 
Traceback (most recent call last): File "/usr/bin/unoconv", line 24, in import uno,
unohelper File "/usr/lib/python2.7/dist-packages/", line 34, in import pyuno SystemError: dynamic module not initialized properly

How can I solve this problem?

Thanks in advance.

share|improve this question

Apach may be configured to disallow calling some command/libs...

But maybe environment variables (e.g. $PATH...) are not just the same for your user and Apach user (www-data) or something like that.

Here is an example what you can do to search the issue:

Try to call set or setenv to get the list of the variables.

Create a basic script


(do not forget chmod +x to give execution permission):

Then call this bash script from PHP:

$output = shell_exec ('/your/dir/ 2>&1');
echo $output


exec ("/your/dir/", $output, $exitstatus);
print_r ($output);

Then check the difference with your own set call.

Finally provide the missing variables like that:

$output = shell_exec('PATH=aaa:bbb:ddd unoconv -f pdf test.odp 2>&1');
share|improve this answer
Thank you for answer but still have same problem.... – Ariful Islam Jan 20 '12 at 9:05
Hi @Arif. What have you tested? Differences within the environment variables? Have you tried to log on using Apach user (www-data) and then to run unoconv? – olibre Jan 20 '12 at 14:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.