[CWB] Cwb binaries not in PATH, setting up PHP

Jori Mantysalo jori.mantysalo at tuni.fi
Tue Aug 30 11:08:37 CEST 2022


Hi all. I am an IT admin at University of Tampere, Finland.

I was asked to install CWB corpus tools and www-gui for those. In Ubuntu 20 I 
was able to build CWB and it seems to work from the command line. PHP almost 
work too, but unfortunately exec() (and system()) does not found binaries 
outside normal /bin/, /usr/bin etc.

First, how to set "binaries root" for the system?

Second, if that is not possible: To the Apache config I put

<Directory /var/www/html/mytest>
     SetEnv PATH /usr/bin:/sbin: . . . :/mytest/cwb-3.4.22/cqp:/mytest/cwb-3.4.22/utils
</Directory>

and now print getenv("PATH"); on /var/www/html/mytest/showpath.php shows 
directories I set to config. But still exex() and system() (and passthru() etc, 
I suppose) does not found binaries.

I guess others have already figured out how to this. I could do something like

find cqp utils -perm /100 | while read f; do ln -s ... /usr/local/bin/$(basename $f); done

but that feels clumsy.

-- 
Jori Mäntysalo

Tampereen yliopisto - Ihminen ratkaisee


More information about the CWB mailing list