From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95181 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: Invoking ConTeXt from inside php web appliction Date: Fri, 17 Jun 2016 14:21:44 +0200 Message-ID: References: <20160617121655.GC34324@lahore> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1672796594911327065==" X-Trace: ger.gmane.org 1466166156 11305 80.91.229.3 (17 Jun 2016 12:22:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 12:22:36 +0000 (UTC) To: Pavneet Arora , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 17 14:22:19 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bDsmw-0002aE-RD for gctc-ntg-context-518@m.gmane.org; Fri, 17 Jun 2016 14:22:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 80CEEF6A6; Fri, 17 Jun 2016 14:21:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DnJLhPKoSYjl; Fri, 17 Jun 2016 14:21:57 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id D9E89F6A0; Fri, 17 Jun 2016 14:21:57 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 96D28F6A0 for ; Fri, 17 Jun 2016 14:21:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ooMZqxohN4cI for ; Fri, 17 Jun 2016 14:21:56 +0200 (CEST) Original-Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 0F65AF69D for ; Fri, 17 Jun 2016 14:21:45 +0200 (CEST) Original-Received: by mail-lf0-f47.google.com with SMTP id q132so59199428lfe.3 for ; Fri, 17 Jun 2016 05:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=AHrGECoO3P5VDfHsIXUPBf5iJmjGLeNILZ+U6ZFoa5o=; b=YhWpQcVkPx8zsN5c7budQtcAMXrLvRzdZoKzjsf23/b4/edsrEZYAP3Z3VtsB9QgXd b963MtIyS5Oi84qvtOePnDoyLVac5fecMx6G9HY+tUvzta+io4dU1Apz4MuMKZAb5N5l OhPYoVmDbRRwqshSA3R+fA68ANvDEm3xQspsU7RFIr3E1nveC2JbIFXcxogTdNVPFQj+ 33Zh9jZkDiClh9Cn6XjpVgvnEE4SKqnOfISDuBjznMgvUsMG8Zx0SphWIvFMeX+0vFJE 5ilgNDcsnoU22Qd8aUmcGgWb+Hkm4p96T87LMxwJt69w6PpKxoOJGPyKDJkCNSpJYyet KQUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=AHrGECoO3P5VDfHsIXUPBf5iJmjGLeNILZ+U6ZFoa5o=; b=WAFuOnn2G6pWDlgkiU9cPo6zBL5atXv9qwBba/7tUJLWJjBFtekX2hcbJE59Flji3B N+xqzdJ4AYyuvhBOUzHW0Q+RLrpSe6zU7SCAFaW8FKn5mr3JlKouh1vYxsq42nkuTsIM Q+4XeckgxTya6UCzOxjuo9Drr0SdxuGzJwRPyEAYmzubHqWsCC/fE/h0fU8cHjoPo8wU FKPmOkplQ5lCATlKNjlr++aV/dd/YvaW6Vaf6cP1rfxYUYUr6iYwy4txb33bskdbh2ur uDE7ycSjTyeifUvslXCn4TWBx7NZCl92CuN+BG928T6Ad4ri4ykbVUlyjxYKGpTpwQPJ bD7w== X-Gm-Message-State: ALyK8tK8fuw+HNH+zVmpspDV1vi8bBZuWa7eaHPdy2rJNTt9ks2x8W1kyG9gi26LzaxqATDj8CBUl4ZxMpe3gg== X-Received: by 10.25.3.12 with SMTP id 12mr502846lfd.110.1466166105306; Fri, 17 Jun 2016 05:21:45 -0700 (PDT) Original-Received: by 10.25.42.194 with HTTP; Fri, 17 Jun 2016 05:21:44 -0700 (PDT) In-Reply-To: <20160617121655.GC34324@lahore> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:95181 Archived-At: --===============1672796594911327065== Content-Type: multipart/alternative; boundary=001a113ec466e379ab0535786547 --001a113ec466e379ab0535786547 Content-Type: text/plain; charset=UTF-8 On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora wrote: > I am stuggling with getting ConTeXt to run from inside a php script > under Apache. First off, let me say that the installation works fine > from the command line as a logged in user. > > Initially, I tried to do it inline: > > cmd = ". /opt/context/tex/setuptex /opt/context/tex/setuptex; cd > $spool_dir; context $full_input_filename"; > system($cmd); > > which returns exit status 2, "Incorrect usage". > > Then I created a small bash script with the following lines: > > #!/usr/bin/env bash > > . /opt/context/tex/setuptex /opt/context/tex > context $1 > > When I trap the output, I get the following error in the log file: > > resolvers | caches | fatal error: there is no valid writable cache > path defined > > I also attempted this manually at a bash prompt resulting in the same > error: > > sudo -u www-data bash -c bin/proccontext.sh $FILENAME > > What would be the correct design pattern to invoke ConTeXt from a web > application? This is all under Ubuntu 14.04, BTW. > > advTHANKSance > > permissions ? -- luigi --001a113ec466e379ab0535786547 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora <pavneet_arora@wa= roc.com> wrote:
I am stuggl= ing with getting ConTeXt to run from inside a php script
under Apache.=C2=A0 First off, let me say that the installation works fine<= br> from the command line as a logged in user.

Initially, I tried to do it inline:

=C2=A0 cmd =3D ". /opt/context/tex/setuptex /opt/context/tex/setuptex;= cd $spool_dir; context $full_input_filename";
=C2=A0 system($cmd);

which returns exit status 2, "Incorrect usage".

Then I created a small bash script with the following lines:

=C2=A0 #!/usr/bin/env bash

=C2=A0 . /opt/context/tex/setuptex /opt/context/tex
=C2=A0 context $1

When I trap the output, I get the following error in the log file:

=C2=A0 resolvers=C2=A0 =C2=A0 =C2=A0 =C2=A0| caches | fatal error: there is= no valid writable cache path defined

I also attempted this manually at a bash prompt resulting in the same
error:

=C2=A0 sudo -u www-data bash -c bin/proccontext.sh $FILENAME

What would be the correct design pattern to invoke ConTeXt from a web
application?=C2=A0 This is all under Ubuntu 14.04, BTW.

advTHANKSance


permissions ?

--
luigi
--001a113ec466e379ab0535786547-- --===============1672796594911327065== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1672796594911327065==--