Koozali.org: home of the SME Server

Modify $PATH for user www

Offline kb-ohnemus

  • *****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
Modify $PATH for user www
« on: May 30, 2008, 09:16:12 PM »
Hi,

I've just installed lx-office (a german fork of sql-ledger, web based accounting). In order to create invoices and so on lx-office calls pdflatex. Tetex provided by SME-Server didn't seem to have all features needed by the invoice-templates of lx-office so I installed texlive.

The problem now ist that the pdflatex executable is under /usr/local/texlive/2007/bin/i386-linux. I changed /etc/profile and added that path which made it available to root but not to the webserver. The lx-office-Perl-script still cant find it:

[Fri May 30 21:06:03 2008] [error] [client 192.168.0.115] sh: pdflatex: command not found, referer: https://server.local/lx-erp/is.pl?login=andsoon...

I also tried to add PATH=$PATH,/usr/local/texlive/2007/bin/i386-linux \ export PATH to the following places:
/home/e-smith/.bashrc
/home/e-smith/.bash_profile (/home/e-smith is set as ~ for user www in etc/password)
/etc/bashrc
/etc/csh.login
/etc/init.d/httpd
/etc/init.d/httpd-e-smith

but to no avail so far.

So where is $PATH defined for user www? Or do I miss something else?

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Modify $PATH for user www
« Reply #1 on: May 30, 2008, 09:43:30 PM »
Hi

IMO you can simply create a link in the folder this file is expected to be and, optionally, change owner and permission..

HTH
Ciao
Stefano

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Modify $PATH for user www
« Reply #2 on: May 31, 2008, 12:04:56 AM »
The lx-office-Perl-script still cant find it:

Change that script to use the full path.

Offline kb-ohnemus

  • *****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
Re: Modify $PATH for user www
« Reply #3 on: May 31, 2008, 07:22:01 AM »
Thanks. I had already tried to set symlinks to known paths and I had tried to schange the Perlscript to use the full path. The problem ist pdflatex calls further executables and which cannot be found then.

And I've tested this: I added system("echo $PATH > /tmp/test1"); to the Perlscript in order to see which paths it knows. But it gives back exactly nothing, not even /usr/bin which it should know because it can find the executable if i link it to /usr/bin. So maybe I am completly wrong and don't need to change PATH but some other path setting, maybe for perl or apache?
« Last Edit: May 31, 2008, 08:41:49 AM by kb-ohnemus »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Modify $PATH for user www
« Reply #4 on: May 31, 2008, 05:09:00 PM »
Thanks. I had already tried to set symlinks to known paths and I had tried to schange the Perlscript to use the full path. The problem ist pdflatex calls further executables and which cannot be found then.

Set $ENV{PATH} to whatever you want in that perl script.

Offline kb-ohnemus

  • *****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
Re: Modify $PATH for user www
« Reply #5 on: May 31, 2008, 06:55:31 PM »
Hey Charlie, you absolutly made my day, thanks.