Tex Filter debuging

Tex Filter debuging

by John Smith -
Number of replies: 20

Hi,

I am having problem debugging the Tex Notation Filter, when i chose the option "Show a graphic image of the algebraic expression rendered with mimetex",It displays the image of the expression

f(x)=\int_{-\infty}^x~e^{-t^2}dt its mean moodle is having access to mimetex.exe file of algebra filter and there is no issue regarding the permissions to the file, however when i chose the option "Show a graphic image of the algebraic expression rendered with Tex/Ghostscript."  it shows me the following error.


Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/latex) is not within the allowed path(s): (/var/www/vhosts/mywebsite.com/:/tmp/) in /var/www/vhosts/mywesbite.com/httpdocs/moodle/filter/tex/texdebug.php on line 204

Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/dvips) is not within the allowed path(s): (/var/www/vhosts/mywebsite.com/:/tmp/) in /var/www/vhosts/mywebsite.com/httpdocs/moodle/filter/tex/texdebug.php on line 212

Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/convert) is not within the allowed path(s): (/var/www/vhosts/mywebsite.com/:/tmp/) in /var/www/vhosts/mywebsite.com/httpdocs/moodle/filter/tex/texdebug.php on line 220 Error creating image, see command execution output for more details.


The same error is appearing on the top inside the setting of TeX notation filter, please let me know how can i resolve this issue.


Regards,

-J

Average of ratings: -
In reply to John Smith

Re: Tex Filter debuging

by Marc Grober -

This is an issue often discussed in the forum, and you should have no problem educating yourself on open-basedir and its implications if you do a simple web search.

If you are on a shared host, your best bet is to simply use MathJax, but since you provide absolutely no information about your host or the version of moodle you are running it would be difficult to advise you further.

In reply to Marc Grober

Re: Tex Filter debuging

by John Smith -

I understand your point, i have done research to solve this issue but i found no luck so i decided to start a new post regarding this issue.

I am using PLESK and yes it is share hosting but i dont think its the issue of  hosting because its was just working fine on moodle 1.9 and i have upgraded to moodle 2.7 and also changed the host.


Initially it was not showing the image using mimetex then i found that PLESK is not giving permission to moodle to access the mimetex.exe file then i changed the permission then it start to show the image using mimetex.


I am using moodle 2.7.

Regards,

-J



In reply to John Smith

Re: Tex Filter debuging

by Marc Grober -

There are a variety of ways to address open_basedir (amazingly, I found this in about 3 seconds https://moodle.org/mod/forum/discuss.php?d=193689, which addresses one approach), which is a php issue and almost always shows up because you are on a shared host...   Frankly if you can't resolve this yourself you are undoubtedly better off using MathJax, especially as that is now the default.   If you want to try to address the issue, good for you. Do a query and start reading https://www.google.com/search?q=php+open_basedir+directive

smile

In reply to John Smith

Re: Tex Filter debuging

by Joshua Bragg -

I'm not sure what version of Plesk you're using.  The latest 11.5 update changed the location for the file you need...

You need to edit your php.ini file to add the paths in the error message to the open_basedir directive.  You should be able to do this from with Plesk if you're using 11.5.

In reply to Joshua Bragg

Re: Tex Filter debuging

by John Smith -

Thank you Joshua.

Yes i am using 11.5 version of PLESK but i am not able to change the php.ini file from my side due to permissions, but i will ask support to change that, will you please let me know the following path is correct for open_basedir

open_basedir = "/var/www/vhosts/epmns.org/:/tmp/"  to


open_basedir = "/var/www/vhosts/mywebsite.com/httpdocs/moodle/"

moodle is the directory name where i have installed the moodle 2.7.



Regards,

-J

In reply to John Smith

Re: Tex Filter debuging

by Joshua Bragg -

John, you really do need to read up on this more like Marc suggested...

What you're going to ask your support folks to do is not what you want.  You need to specify the paths to the executables in the open_basedir directive.

/usr/bin/latex
/usr/bin/convert
/usr/bin/dvips

Please go read up on this...  It is probably also a bad idea to disable access to /tmp.

In reply to John Smith

Re: Tex Filter debuging

by Marc Grober -

John,

The link I provided made it pretty clear what the issue is, and it apparently went right over your head,  which suggests, as I previously argued, that you disable the TeX filter and use MathJax.

Joshua has drawn you a picture, and has underscored my advice - either drop the TeX filter or read enough about php directives that you have a clear understanding of what the issues are and how these issues are addressed in shared hosting.

In reply to Marc Grober

Re: Tex Filter debuging

by John Smith -

Marc,

I am not using Mathjax because i am not sure it handles the questions in the following format

@@int((5x + 2) dx,1,2)@@

The post in your answer really not went over my head the problem is i can not try different solutions because i  dont have access to php.ini file due to permissions in plesk, thats why i decided to take help from this forum and i am sorry but i dont like your behavior, and i am not forcing you to answer my post.


Regards,

-J


In reply to John Smith

Re: Tex Filter debuging

by Marc Grober -

Well, Mr. ThinSkin,

Yes, MathJax will handle double@ signs,  but you will have to read and parse documentation on how to include those as tokens.

Yes, it did go over your head because you proposed to Joshua a proposal that did not address the recommendations of the forum post I found in about 3 seconds.

Don't know what passes for research where you are,  but knock yourself out and mangle your install any way you see fit. 

smile

In reply to John Smith

Re: Tex Filter debuging

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

The @@ signs are usually associated with the Algebra filter rather than the related, but independent TeX filter. In that case MathJax will not help any.  This may mean the he needs mimetex installed operational rather than LaTeX binaries.

In reply to Daniel Thies

Re: Tex Filter debuging

by Marc Grober -

Ahhhhh,  Daniel has much better ESP than I, lol.  I use double@s with MathJax as I don't use the Algebra filter...

In that case  the OP needs to do what Danial has offered elsewhere, decouple Algebra filter from the TeX filter and feed the results of the Algebra filter to Mathjax wink

In reply to Marc Grober

Re: Tex Filter debuging

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

He upgraded from 1.9 which probably has a big algebra closet. I forgot I had posted the fix for using MathJax with the Algebra filter. According to the rules am I suppose to explain how to use the attached file or just tell them to read the whole thread and guess?

In reply to Daniel Thies

Re: Tex Filter debuging

by Marc Grober -

Well, first off, see the thread he created on the MathJax list which I posted somewhere above (as that suggests other issues).

I understand that language is often a problem in this forum and that most who are not English speakers are doing a better job with English than I would likely do with their language, but when someone tells me that they did the research and that nothing has gone over their head,  I am likely to suggest that they be allowed to swim in their own juices.... 

Is that against the rules?  Well, King Martin has regularly stated the Moodle policy - he who owns the stuff makes the rules,  which seems to mean to him that he gets to say or do anything he wants, lol, so I think you are entitled to at least the same latitude (at least until he applies the Hyndman Procedure, rofl.) 

I do read that really bad NYTIMES Mag column called The Ethicist regularly, but I don't seem to recall much in the way of valuable insight, so what to do if someone a la the Ameglian Major Cow asks to be butchered? I suppose my answer would be to serve yourself (ok,  that was bad, but not THAT bad.)

The key for me has been to help people help themselves, which I always thought was somewhere between RTFM and ASWGAS. I suppose I don't have the best of attitudes, but then I have always thought oracles were more along the lines of Neverending Story than Mother Goose. I'd rather a knowledgeable and sincere curmudgeon than a saccharine bozo.

If that hasn't muddied the waters, please advise.

smile

In reply to Daniel Thies

Re: Tex Filter debuging

by Marc Grober -

But, as you can see from the OP's post to the MathJax mailing list below, it would seem that the OP simply wants to use double and single @ signs to do malformed TeX..... 

Go figure.....

**********************************

-------- Original Message --------
Subject:     Re: [mathjax-users] Expressions with double @ sign
Date:     Fri, 13 Jun 2014 15:51:12 +0500
From:     We Build to Gether <webuildtogether2011@gmail.com>
Reply-To:     mathjax-users@googlegroups.com
To:     mathjax-users@googlegroups.com

Hi,
Thank you so much for the help so far, do you know how we can configure
this inside the moodle 2.7?

On Fri, Jun 13, 2014 at 2:15 PM, Peter Krautzberger
<peter.krautzberger@mathjax.org <mailto:peter.krautzberger@mathjax.org>>
wrote:

    Hi,
    That's easy then. The documentation as at
    http://docs.mathjax.org/en/latest/options/tex2jax.html and here's a
    live sample http://codepen.io/pkra/pen/aultp/
    Peter.

    On Fri, Jun 13, 2014 at 11:04 AM, We Build to Gether
    <webuildtogether2011@gmail.com
    <mailto:webuildtogether2011@gmail.com>> wrote:

        Hi Peter,
        Thank you so much for replying to my post, yes i am asking
        for  configuring @ and @@ as delimiters for MathJax's,(TeX), so
        that above equation should be readable using MathJax, because i
        dont want to use Tax notation as it was configured previously on
        my website to show the above equation.
        Thank you

        On Fri, Jun 13, 2014 at 12:53 PM, Peter Krautzberger
        <peter.krautzberger@mathjax.org
        <mailto:peter.krautzberger@mathjax.org>> wrote:

            Hi,
            It's not clear to me what exactly you're after here. Are you
            asking about configuring @ and @@ as delimiters for
            MathJax's (TeX or asciimath) input or are you asking for
            support for computer-algebra-style input?
            The first is easy, the second is currently not available
            (but I guess a Wolfram-alpha plugin would be neat there)
            Regards,
            Peter.


            On Fri, Jun 13, 2014 at 9:07 AM,
            <webuildtogether2011@gmail.com
            <mailto:webuildtogether2011@gmail.com>> wrote:
                Hi,
                I would like to know how MathJax will read the
                mathematical expressions with double @ sings similar to
                the following expression @@int((5x + 1) dx,1,3)@@, i am
                new to MathJax so i dont know how can i pass the token
                to MathJax to make him readable for the expressions like
                this.
                Thank you.
                --

In reply to Daniel Thies

Re: Tex Filter debuging

by John Smith -
Hi Daniel,

I have upgraded from moodle 1.9 to 2.7,  we have used Algebra filter to show equation of the following format @@int((5x + 20) dx,1,2)@@ all questions were working fine in moodle 1.9 with safe mode off which we have set in php.ini file inside the moodle installation folder.

After upgrading from 1.9 to 2.7  the questions are not working and showing some text like "undetermined error" i have also set the permission to mimetex.exe file in side the filter/tex readable and it is showing image when i chose the option to show image using mimetex on the following url
url moodle/filter/tex/texdebug.php.

I shall be very thankful to you if you would help me on this.

Thank you


In reply to John Smith

Re: Tex Filter debuging

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

The first question is perhaps do you want to use MathJax or the mimetex to do the rendering? Either is normally possible, but as Marc suggested MathJax may be easier in your case.  If you want to try MathJax, enable MathJaxloader first in the filter settings and make sure it is working with TeX with something like \(\sqrt x\) on a page which should look like \(\sqrt x\) when displayed. To use mimetex you need a working version of mimetex on the server and to resolve the open_basedir issue.

In reply to John Smith

Re: Tex Filter debuging

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

I reread your second paragraph, and it appears that you have the TeX filter working with mimetex.  Can you put TeX code like that above on a page and verify that it renders as a image?

In reply to Daniel Thies

Re: Tex Filter debuging

by John Smith -

Daniel ,Thank you so much for your help, i have solved the problem on my own, actually it was the algebra filter which needed to be fixed.

In reply to John Smith

Re: Tex Filter debuging

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

That is great John.  Could you tell us what specifically you did to fix the problem you were having with the Algebra filter?  That would be a great help for us if some has a similar problem in the future.