[CWB] ERROR: CQP backend startup failed

egobrc at gmail.com egobrc at gmail.com
Tue Mar 24 21:05:38 CET 2015


Hi Andrew,
your suggestions led me to the solution. To test if there were any OS-level
security blocks, I wrote a sample php page containing:

chdir('/usr/local/bin/');
$output2 = shell_exec('./cqp -c');
echo $output2;

And it printed out cqp version. Conversely, removing 'chdir' line gave no
output: clearly there was a $PATH related problem. I modified the php test
page inserting:

chdir('/bin/');
$output = shell_exec('./echo $PATH');
echo $output;

And the output showed only /bin and /sbin, although executing "echo $PATH"
as wwwrun user listed many more folders, including /usr/local/bin, as I
told you in a previous email. Searching around Apache documentation, I
found about envvars file, that provides "in a different way" further
variables for Apache: setting $PATH in that file solved my problems with
CQPweb, now there are no errors deleting users and adding groups.

During my attempts, I printed out from cqp.inc.php the value
of $path_to_cqp and it was always empty...although I have configured it
in config.inc.php . Maybe this information can be useful to understand
where I made a configuration error?

Thanks for all the support.


2015-03-23 2:29 GMT+01:00 Hardie, Andrew <a.hardie at lancaster.ac.uk>:

>  OK, that version of CQPweb is the most recent, so we are both looking at
> the same thing.
>
>
>
> Now, the reason that you are getting the message you are getting is that
> when the proc_open function is called in the PHP code to create the slave
> cqp process, it is not returning a process-resource: instead it is
> returning *false* to indicate an error.
>
>
>
> Question is, why?
>
>
>
> It is probably something to do with either your OS, or your Apache
> configuration.
>
>
>
> Running external processes from a PHP web-script is seen as insecure, for
> obvious reasons. So, several Linux distros have taken it upon themselves to
> distribute Apache/PHP with configurations set by default to disallow this.
> But this functionality is critical for CQPweb, again for obvious reasons.
>
>
>
> I am afraid I am not familiar with SUSE. However, here are the things that
> I know of that might be causing the problem, based on my experience with
> Debian and Fedora.
>
>
>
> ·         Is PHP running in safe-mode? IF so, proc_open is disabled for
> most of the filesystem. See here
> http://php.net/manual/en/features.safe-mode.functions.php
>
> ·         Do you have AppArmor installed and running? If so, is it
> blocking web scripts from accessing the part of your filesystem where CQP
> lives? Look in /etc/apparmor.d/…
>
> ·         Is there something in the Apache configuration blocking access
> to anything outside the default document tree?
>
> ·         Does your Linux distro have SELinux, and if so, is it perhaps
> configured to not let Apache/PHP execute child processes?
>
>
>
> Let us know if one of these pans out!  If it turns ou that this is a
> “gotcha” likely to affect many people, then I will add it to the manual.
>
>
>
> best
>
>
>
> Andrew.
>
>
>
> *From:* cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] *On
> Behalf Of *egobrc at gmail.com
> *Sent:* 18 March 2015 10:41
> *To:* cwb at sslmit.unibo.it
> *Subject:* Re: [CWB] ERROR: CQP backend startup failed
>
>
>
> Hi Andrew, first of all thanks for your answer.
>
> I logged in as apache user (in my case is wwwrun since it is a Suse SLES
> 11 Linux) and cqp is included in $PATH because it is in /usr/local/bin. I
> also tried to run cqp logged in as wwwrun and it starts normally, printing
> out "CQP version 3.0.0" as usual.
>
>
>
> To get CQPweb version i found:
>
>
>
>  define('CQPWEB_VERSION', '3.1.13');
>
>
>
> in CQPweb/lib/environment.inc.php; if it can be of some help, I used svn
> checkout to download the software.
>
> Am I using wrong versions of CQP and/or CQPWeb? In my environment CWB will
> not be used in English.
>
>
>
> Have a nice day.
>
>
>
> One think comes to mind: is the CQP executable on the PATH of the username that Apache runs under? If not,  then that’s the problem, and you need to add the path to the location of the executable to the CQPweb configuration file.
>
>
>
> If that isn’t the problem then we can consider other possibilities. Before that, however: Can you check your version of CQPweb please?
>
>
>
> note also that using the core CWB version 3.0.x with CQPweb will work, but is not recommended (since CQPweb works solely in UTF-8, and v3.0 of the core doesn’t support utf8 regular expressions). for English you wouldn’t notice much difference, for other languages you might.
>
>
>
> best
>
>
>
> Andrew.
>
>
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://devel.sslmit.unibo.it/mailman/listinfo/cwb
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://devel.sslmit.unibo.it/pipermail/cwb/attachments/20150324/22b1a419/attachment.html>


More information about the CWB mailing list