Errors while printing reports. Warning: tempnam() [function.tempnam]: open_basedir restriction in ef
  • January 1970 Edit

    I noticed on your demo site you have no entries on your open_basedir option for php.

    My site is on a shared hosting plan. How can I correct this problem?




    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s):

  • justinjustin October 2007

    Hey Santo

    ask your host if you can turn php safe mode off

    http://au3.php.net/features.safe-mode

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • aplysiaaplysia October 2007

    @justin: I think it's a good idea to enable php safe-mode. So I'm looking for another solution.
    In principal we got the /cache directory for such file. So I think we could change the following line:

    $sPath = tempnam(null,"check");
    to
    $sPath = tempnam("./cache","check");

    What do you think?

  • justinjustin October 2007

    @aplysia
    - if that(or something similar) works go for it!
    - sounds good

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • SantoCSantoC October 2007

    good call aplysia! i guess the fact of the matter is php safe mode is useless for the most part if you are trying to make real use of php. i'm on a shared hosting plan an its a pain to get the admins to do anything.

  • aplysiaaplysia October 2007

    @SantoC: Can you please test this one for me?
    Please change in the file moduls/reports/PHPReportsUtil.php line 53 to the following:
    $sPath = tempnam("./cache","check");

    Perhaps it's
    $sPath = tempnam("../cache","check");
    or
    $sPath = tempnam("../../cache","check");

    Thx

  • SantoCSantoC October 2007

    believe me the first thing i did was try your suggestion...it works like a charm..sorry i did not mention that in the previous post....

  • justinjustin October 2007

    @santo

    just to confirm
    which worked

    $sPath = tempnam("./cache","check");
    or
    $sPath = tempnam("../cache","check");
    or
    $sPath = tempnam("../../cache","check");

    let me know and i'll update the code

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • aplysiaaplysia October 2007

    @justin. Please document it somewhere. Because if we update the phpreport code, we have to update it.

  • SantoCSantoC October 2007

    Sorry...
    $sPath = tempnam("./cache","check");

    That is the line I used.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories