ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Invoking ConTeXt from inside php web appliction
@ 2016-07-09 15:45 Pavneet Arora
  2016-07-09 20:56 ` Henning Hraban Ramm
  0 siblings, 1 reply; 16+ messages in thread
From: Pavneet Arora @ 2016-07-09 15:45 UTC (permalink / raw)
  To: ntg-context

Dear Hraban,

Sorry that this has taken me so long.  The report card application has
been deployed, and although I am still going through and resolving minor
bugs, it is very much in use (350 students leaving on Tu who already have
their foundation work marked and commented within the system; output via
ConTeXt).

Anyway, I have updated the Wiki, but am unsure if I missed anything. So
can everyone have a look and let me know:

http://wiki.contextgarden.net/ConTeXt_Standalone#Apache_webserver_installation

Regards.

> Henning Hraban Ramm texml at fiee.net
> Fri Jun 17 20:49:11 CEST 2016
>
>  Please document this in the wiki (I had similar problems, should have
done it at that time…)


-- 
Pavneet Arora       m: 647.406.6843
Waroc Informatik    w: 416.937.9276




___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-07-09 15:45 Invoking ConTeXt from inside php web appliction Pavneet Arora
@ 2016-07-09 20:56 ` Henning Hraban Ramm
  2016-07-09 23:02   ` Pavneet Arora
  0 siblings, 1 reply; 16+ messages in thread
From: Henning Hraban Ramm @ 2016-07-09 20:56 UTC (permalink / raw)
  To: pavneet_arora, mailing list for ConTeXt users

Am 2016-07-09 um 17:45 schrieb Pavneet Arora <pavneet_arora@waroc.com>:

> Sorry that this has taken me so long.  The report card application has
> been deployed, and although I am still going through and resolving minor
> bugs, it is very much in use (350 students leaving on Tu who already have
> their foundation work marked and commented within the system; output via
> ConTeXt).

Nice to hear about your success!
In my case, my customer, a publisher of several special interest magazines, uploads lists of customers and their ad bookings into my web app and gets nicely TeXed voucher shipping documents.

> Anyway, I have updated the Wiki, but am unsure if I missed anything. So
> can everyone have a look and let me know:
> http://wiki.contextgarden.net/ConTeXt_Standalone#Apache_webserver_installation

I’m quite sure it’s a bad idea to install ConTeXt (or anything like that) in a public, i.e. web-accessible, directory!
Even if I can’t imagine an attack via accessing files from the ConTeXt tree, experienced attackers might.
I don’t use PHP any more, but I’m quite sure there’s a better way.

I run ConTeXt from a Django (Python) web app behind Nginx, and there only static files (i.e. images, CSS etc.) are directly accessible, and I can call a system-wide installed ConTeXt owned by root (i.e. nobody else can change it).

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-07-09 20:56 ` Henning Hraban Ramm
@ 2016-07-09 23:02   ` Pavneet Arora
       [not found]     ` <CAG5iGsD48qgiHcSjXYERcXrP4fo6pYL0SJTkz7JVqS9bLM+8bA@mail.gmail.com>
  0 siblings, 1 reply; 16+ messages in thread
From: Pavneet Arora @ 2016-07-09 23:02 UTC (permalink / raw)
  To: Henning Hraban Ramm, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 595 bytes --]

I believe that public in this case refers to public assets such as CSS, js, etc., where one puts custom files rather than publicly accessible, e.g., wp-uploads for WordPress.  In the case of most frameworks, URL access is limited to specified routes only which point to controller methods.  ConTeXt, when installed in this manner,  can only be run as www-data:www-data, i.e., by httpd.

I wasn’t able to get it work using any of the other suggestions.  Is there another template you can suggest?

Pavneet Arora
m: +1 (647) 406-6843
e: pavneet_arora@waroc.com

From: Henning Hraban Ramm

[-- Attachment #1.2: Type: text/html, Size: 3110 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
       [not found]     ` <CAG5iGsD48qgiHcSjXYERcXrP4fo6pYL0SJTkz7JVqS9bLM+8bA@mail.gmail.com>
@ 2016-07-11 16:14       ` Pavneet Arora
  0 siblings, 0 replies; 16+ messages in thread
From: Pavneet Arora @ 2016-07-11 16:14 UTC (permalink / raw)
  To: luigi scarso, ConTeXt Mailing list


[-- Attachment #1.1: Type: text/plain, Size: 948 bytes --]

In principle this is workable up to the point that the output PDF needs to be handed off to the user.  In my case, it is the (authenticated) parent who is requesting their child’s report card in one of two forms each of which is created dynamically at any point along the school “term”.  The user is waiting for the output PDF from the browser.  In Laravel this is accomplished by using:

return response()->download($full_output_filename)->deleteFileAfterSend(true);

whereupon the end user sees the familiar Open, Save, … dialogue.

But the dispatcher pattern is very useful, and I like it very much.  In another area, I use it to monitor a directory for forms input, which are done off-line on W10 tablets using a browser and the Mongoose lightweight httpd, and then uploaded using sftp (under Cygwin). 

Thanks, again, for the suggestions.

Pavneet Arora
m: +1 (647) 406-6843
e: pavneet_arora@waroc.com

From: luigi scarso

[-- Attachment #1.2: Type: text/html, Size: 7571 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:25   ` Pavneet Arora
  2016-06-17 12:34     ` luigi scarso
@ 2016-07-11 12:50     ` massifr
  1 sibling, 0 replies; 16+ messages in thread
From: massifr @ 2016-07-11 12:50 UTC (permalink / raw)
  To: Pavneet Arora, mailing list for ConTeXt users

> That is what I suspect as well.  How do I find out which cache path is 
> being used?
> 

I'm using Debian+ConTeXt+Apache+PHP.
I've struggled a bit to make it work, but now it works.
It works even inside a docker container.

In my PHP code I've put this:

putenv("TEXMFCACHE=/var/cache/context/texmf-cache");

This forces ConTeXt to use that directory as cache.
Then I made /var/cache/context/texmf-cache world-writable:

chmod ugo+rwx /var/cache/context/texmf-cache

Perhaps it's not the best choice for security.
Try that and tell me if it works.

Best regards,
Massi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:16 Pavneet Arora
  2016-06-17 12:21 ` luigi scarso
@ 2016-06-17 20:06 ` Mojca Miklavec
  1 sibling, 0 replies; 16+ messages in thread
From: Mojca Miklavec @ 2016-06-17 20:06 UTC (permalink / raw)
  To: Pavneet Arora, mailing list for ConTeXt users

On 17 June 2016 at 14:16, 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);

Unrelated to the problem, but ...

Instead of sourcing setuptex you should just add
/opt/context/tex/texm-linux64 (or whawever folder that is) to the
environmental variable PATH.

The setuptex script doesn't do anything else and is just a convenience
script for users. In scripting you should better set PATH. You can
also manually set TEXMFCACHE if you want. Not that it matters much,
but I don't know why one would want the overhead of running an
additional script each time.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 14:57       ` Pavneet Arora
@ 2016-06-17 18:49         ` Henning Hraban Ramm
  0 siblings, 0 replies; 16+ messages in thread
From: Henning Hraban Ramm @ 2016-06-17 18:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 2016-06-17 um 20:57 schrieb Pavneet Arora <pavneet_arora@waroc.com>:

> $ chmod -R www-data:www-data context
> 
> So ConTeXt is installed in .../www/public/context.
> 
> Now I can source:
> 
>  $ . .../www/public/context/tex/setuptex .../www/public/context/tex
> 
> and it all works.

Please document this in the wiki (I had similar problems, should have done it at that time…)

E.g. "Webserver_Setup", linked from http://wiki.contextgarden.net/ConTeXt_Standalone#Unix-like_platforms_.28Linux.2FMacOS_X.2FFreeBSD.2FSolaris.29

I’ll add my setup behind a Django/Nginx installation.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)
GPG Key ID 1C9B22FD

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
       [not found]     ` <CAG5iGsBpLw8uTFyH7E5MCqcEoaK82qbyakfJA3teeUkSinQEgg@mail.gmail.com>
@ 2016-06-17 14:57       ` Pavneet Arora
  2016-06-17 18:49         ` Henning Hraban Ramm
  0 siblings, 1 reply; 16+ messages in thread
From: Pavneet Arora @ 2016-06-17 14:57 UTC (permalink / raw)
  To: luigi scarso; +Cc: ConTeXt Mailing list

Ah, we were thinking along the same lines! ;)

I had just initiated a local install inside .../www/public when I 
received your email, which is in fact the DocumentRoot for this website, 
and did:

$ chmod -R www-data:www-data context

So ConTeXt is installed in .../www/public/context.

Now I can source:

  $ . .../www/public/context/tex/setuptex .../www/public/context/tex

and it all works.

Many thanks, Luigi, for all of your suggestions.

On 17Jun16, luigi scarso wrote:
> (off list)
> 
> On Fri, Jun 17, 2016 at 3:39 PM, Pavneet Arora <pavneet_arora@waroc.com>
> wrote:
> 
> > That is really the crux of the issue, since www-data does *not* have a
> > login shell.  It is used only by apache.
> >
> > Can setuptex be made to point to the home directory explicitly where the
> > website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?
> >
> 
> Is it an option to make a context installation only for apache ?
> I mean a context that is owned by www-data (if this is the apache user),
> into a folder readable by apache.
> 
> -- 
> luigi

-- 
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 13:39   ` Pavneet Arora
@ 2016-06-17 14:15     ` Hans Hagen
       [not found]     ` <CAG5iGsBpLw8uTFyH7E5MCqcEoaK82qbyakfJA3teeUkSinQEgg@mail.gmail.com>
  1 sibling, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2016-06-17 14:15 UTC (permalink / raw)
  To: ntg-context

On 6/17/2016 3:39 PM, Pavneet Arora wrote:
> That is really the crux of the issue, since www-data does *not* have a
> login shell.  It is used only by apache.
>
> Can setuptex be made to point to the home directory explicitly where the
> website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?
>
> On 17Jun16, luigi scarso wrote:
>> Is  texmf-cache writable by www-data ?
>> When logged as  www-data, the cache writable should  be the
>> /home/www-data/luatex-cache/<..> folder, while the standard one is used as
>> readonly folder
>>
>> Just make a test: in www-data home
>> # . /opt/context/tex/setuptex /opt/context/tex
>> then make a simple "Hello world" test.tex and  read the log.

you can try

/pathtomtxrun/mtxrun --tree=/home/tex context ....

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:21 ` luigi scarso
  2016-06-17 12:25   ` Pavneet Arora
  2016-06-17 12:42   ` Pavneet Arora
@ 2016-06-17 13:39   ` Pavneet Arora
  2016-06-17 14:15     ` Hans Hagen
       [not found]     ` <CAG5iGsBpLw8uTFyH7E5MCqcEoaK82qbyakfJA3teeUkSinQEgg@mail.gmail.com>
  2 siblings, 2 replies; 16+ messages in thread
From: Pavneet Arora @ 2016-06-17 13:39 UTC (permalink / raw)
  To: luigi scarso; +Cc: ConTeXt Mailing list

That is really the crux of the issue, since www-data does *not* have a 
login shell.  It is used only by apache.

Can setuptex be made to point to the home directory explicitly where the 
website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?

On 17Jun16, luigi scarso wrote:
> Is  texmf-cache writable by www-data ?
> When logged as  www-data, the cache writable should  be the
> /home/www-data/luatex-cache/<..> folder, while the standard one is used as
> readonly folder
> 
> Just make a test: in www-data home
> # . /opt/context/tex/setuptex /opt/context/tex
> then make a simple "Hello world" test.tex and  read the log.
> 

-- 
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:42   ` Pavneet Arora
@ 2016-06-17 13:25     ` luigi scarso
  0 siblings, 0 replies; 16+ messages in thread
From: luigi scarso @ 2016-06-17 13:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1177 bytes --]

On Fri, Jun 17, 2016 at 2:42 PM, Pavneet Arora <pavneet_arora@waroc.com>
wrote:

> Unfortunately, while the mtxrun command works for a shell user:
>
>   $ mtxrun -script base --variables | grep cache
>   resolvers       | lists |   env: $SELFAUTOPARENT/texmf-cache
>   resolvers       | lists |   var: $SELFAUTOPARENT/texmf-cache
>   resolvers       | lists |   exp: /opt/context/tex/texmf-cache
>   resolvers       | lists |   res: /opt/context/tex/texmf-cache
>
> the result is the same for www-data:
>
>   $ sudo -u www-data bash -c ". /opt/context/tex/setuptex
> /opt/context/tex; mtxrun --script base --variables | grep cache"
>   resolvers       | caches | fatal error: there is no valid writable cache
> path defined
>
> I have to think that setuptex isn't able to set up the runtime
> environment for www-data, somehow?
>
>
Is  texmf-cache writable by www-data ?
When logged as  www-data, the cache writable should  be the
/home/www-data/luatex-cache/<..> folder, while the standard one is used as
readonly folder

Just make a test: in www-data home
# . /opt/context/tex/setuptex /opt/context/tex
then make a simple "Hello world" test.tex and  read the log.

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1870 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:21 ` luigi scarso
  2016-06-17 12:25   ` Pavneet Arora
@ 2016-06-17 12:42   ` Pavneet Arora
  2016-06-17 13:25     ` luigi scarso
  2016-06-17 13:39   ` Pavneet Arora
  2 siblings, 1 reply; 16+ messages in thread
From: Pavneet Arora @ 2016-06-17 12:42 UTC (permalink / raw)
  To: luigi scarso; +Cc: ConTeXt Mailing list

Unfortunately, while the mtxrun command works for a shell user:

  $ mtxrun -script base --variables | grep cache
  resolvers       | lists |   env: $SELFAUTOPARENT/texmf-cache
  resolvers       | lists |   var: $SELFAUTOPARENT/texmf-cache
  resolvers       | lists |   exp: /opt/context/tex/texmf-cache
  resolvers       | lists |   res: /opt/context/tex/texmf-cache

the result is the same for www-data:

  $ sudo -u www-data bash -c ". /opt/context/tex/setuptex /opt/context/tex; mtxrun --script base --variables | grep cache"
  resolvers       | caches | fatal error: there is no valid writable cache path defined

I have to think that setuptex isn't able to set up the runtime 
environment for www-data, somehow?

On Fri, Jun 17, 2016 at 2:25 PM, Pavneet Arora <pavneet_arora at waroc.com>
wrote:

> That is what I suspect as well.  How do I find out which cache path is
> being used?
>
> Thanks.
>
>
$ mtxrun --script base --variables |grep cache


-- 
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:25   ` Pavneet Arora
@ 2016-06-17 12:34     ` luigi scarso
  2016-07-11 12:50     ` massifr
  1 sibling, 0 replies; 16+ messages in thread
From: luigi scarso @ 2016-06-17 12:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 244 bytes --]

On Fri, Jun 17, 2016 at 2:25 PM, Pavneet Arora <pavneet_arora@waroc.com>
wrote:

> That is what I suspect as well.  How do I find out which cache path is
> being used?
>
> Thanks.
>
>
$ mtxrun --script base --variables |grep cache



-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 789 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:21 ` luigi scarso
@ 2016-06-17 12:25   ` Pavneet Arora
  2016-06-17 12:34     ` luigi scarso
  2016-07-11 12:50     ` massifr
  2016-06-17 12:42   ` Pavneet Arora
  2016-06-17 13:39   ` Pavneet Arora
  2 siblings, 2 replies; 16+ messages in thread
From: Pavneet Arora @ 2016-06-17 12:25 UTC (permalink / raw)
  To: luigi scarso; +Cc: mailing list for ConTeXt users

That is what I suspect as well.  How do I find out which cache path is 
being used?

Thanks.

On 17Jun16, luigi scarso wrote:
> On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora <pavneet_arora@waroc.com>
> wrote:
...
> > > 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

-- 
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Invoking ConTeXt from inside php web appliction
  2016-06-17 12:16 Pavneet Arora
@ 2016-06-17 12:21 ` luigi scarso
  2016-06-17 12:25   ` Pavneet Arora
                     ` (2 more replies)
  2016-06-17 20:06 ` Mojca Miklavec
  1 sibling, 3 replies; 16+ messages in thread
From: luigi scarso @ 2016-06-17 12:21 UTC (permalink / raw)
  To: Pavneet Arora, mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1133 bytes --]

On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora <pavneet_arora@waroc.com>
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

[-- Attachment #1.2: Type: text/html, Size: 1740 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Invoking ConTeXt from inside php web appliction
@ 2016-06-17 12:16 Pavneet Arora
  2016-06-17 12:21 ` luigi scarso
  2016-06-17 20:06 ` Mojca Miklavec
  0 siblings, 2 replies; 16+ messages in thread
From: Pavneet Arora @ 2016-06-17 12:16 UTC (permalink / raw)
  To: ConTeXt Mailing list

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


-- 
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-07-11 16:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-09 15:45 Invoking ConTeXt from inside php web appliction Pavneet Arora
2016-07-09 20:56 ` Henning Hraban Ramm
2016-07-09 23:02   ` Pavneet Arora
     [not found]     ` <CAG5iGsD48qgiHcSjXYERcXrP4fo6pYL0SJTkz7JVqS9bLM+8bA@mail.gmail.com>
2016-07-11 16:14       ` Pavneet Arora
  -- strict thread matches above, loose matches on Subject: below --
2016-06-17 12:16 Pavneet Arora
2016-06-17 12:21 ` luigi scarso
2016-06-17 12:25   ` Pavneet Arora
2016-06-17 12:34     ` luigi scarso
2016-07-11 12:50     ` massifr
2016-06-17 12:42   ` Pavneet Arora
2016-06-17 13:25     ` luigi scarso
2016-06-17 13:39   ` Pavneet Arora
2016-06-17 14:15     ` Hans Hagen
     [not found]     ` <CAG5iGsBpLw8uTFyH7E5MCqcEoaK82qbyakfJA3teeUkSinQEgg@mail.gmail.com>
2016-06-17 14:57       ` Pavneet Arora
2016-06-17 18:49         ` Henning Hraban Ramm
2016-06-17 20:06 ` Mojca Miklavec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).