Menu

Undefined index: PATH

DanJ1980
2012-04-30
2013-04-29
  • DanJ1980

    DanJ1980 - 2012-04-30

    Hi,

    I'm moving to a new server and trying to use phpagi.php. However, i'm getting the following error when I try to use the phpagi.php.

    PHP Notice:  Undefined index: PATH in /var/lib/asterisk/scripts/phpagi.php on line 1693
    PHP Notice:  Undefined index: PATH in /var/lib/asterisk/scripts/phpagi.php on line 1693

    I'm using the latest version of phpagi.php and i'm using php version 5.3.3.
    I'm guessing that its a compatibility problem with php 5.3.3.

    Any idea how i can correct this problem?
    Thanks
    Dan

     
  • Ahmad Samiei

    Ahmad Samiei - 2012-04-30

    It depend on your code and server . but for ignoring this error message you can replace that line with :

    $chpath = (is_null($checkpath) && isset($_ENV['PATH'])) ? $_ENV['PATH'] : $checkpath;
    

    or

    $chpath = is_null($checkpath) ? @$_ENV['PATH'] : $checkpath;
    

    I dont know the effect because I dont know where/how this method called in your code or not .

    Another way is turning off PHP Notice
    with "error_reporting" feature You can turn-off  PHP Notice  when you are in production progress

     
  • DanJ1980

    DanJ1980 - 2012-04-30

    I've downgraded to php 5.1.6 which seems to have removed that error message.

     
  • Ahmad Samiei

    Ahmad Samiei - 2012-04-30

    Sometime you have to customize PHPAgi library to make it more compatible with your work
    Editing that line is seams better than downgrading to old version . 5.1 is very old. but this is your decision.

    You can also create Child class or template or using other OOP methodologies if you want avoid to edit PHPAgi class.
    but the easy way was that one that I try to explain

    And as always, The best way is the way you're comfortable with it
    Have a good time

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.