Howdy, Stranger!

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

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Email piping help

Hi,

Have managed to update to v1.9.1, migration of data is good, except email piping has stopped working

i am getting this message i have edited email address for privacy email piping was working before upgrade ?


EMAIL Response:

This message was created automatically by mail delivery software.

 

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

 

  pipe to |/home/btssn/public_html/ticket/api/pipe.php

    generated by tickets@btssn

    local delivery failed

 

The following text was generated during the delivery attempt:

 

------ pipe to |/home/btssn/public_html/ticket/api/pipe.php

       generated by tickets@btssn ------

 

<br />

<b>Parse error</b>:  syntax error, unexpected T_STATIC in <b>/home/btssn/public_html/ticket/include/class.plugin.php</b> on line <b>122</b><br />

«1

Comments

  • Your command line version of PHP is not 5.3+.  You need to use PHP 5.3+ for osTicket 1.8+.
  • Hi,

    Have update php to 5.3 should i try php 5.4 ?  piping is still giving error and not updating ticket 
  • pull up a command prompt.  Type in php --version.  What does it report?
  • hi need to enable shell access waiting for hostgator to activae had to pay for service :( once active i will rum command and confirm

  • spoke to hosting support they confirmed path has php 5.3 and path seems ok from there side ?
  • i am lost on ideas ? if email piping does not work on 1.9 and 1.8 then i shall have to use 1.7
    Have check pipe.php and all seem ok there

    below is extract of pipe.php file:

    #!/usr/bin/php -q
    <?php
    /*********************************************************************
        pipe.php

        Converts piped emails to ticket. Just local - remote must use /api/tickets.email

        Peter Rotich <peter@osticket.com>
        Copyright (c)  2006-2013 osTicket
        http://www.osticket.com

        Released under the GNU General Public License WITHOUT ANY WARRANTY.
        See LICENSE.TXT for details.

        vim: expandtab sw=4 ts=4 sts=4:
    **********************************************************************/
    ini_set('memory_limit', '256M'); //The concern here is having enough mem for emails with attachments.
    @chdir(dirname(__FILE__).'/'); //Change dir.
    require('api.inc.php');

    //Only local piping supported via pipe.php
    if (!osTicket::is_cli())
        die('pipe.php only supports local piping - use http -> api/tickets.email');

    require_once(INCLUDE_DIR.'api.tickets.php');
    PipeApiController::process();
    ?>

  • i have some db errors showing up in osticket log

    see attached file 
    osticket_logs.docx
    239K
  • hi,

    quick update ran php on shell and here is report :(

    /home/ccsos$ php --version
    PHP 5.2.17 (cli) (built: Jun  4 2012 12:32:19)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
        with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd., and
        with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

    gonna get on hostgator support again
  • domain is running 5.3

    PHP Version 5.3.28


    System Linux merkur.websitewelcome.com 3.2.49 #2 SMP Mon Aug 5 14:12:45 CDT 2013 x86_64
    Build Date Jan 27 2014 18:20:41
    Configure Command './configure' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--enable-fastcgi' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo' '--enable-soap' '--enable-sockets' '--enable-sqlite-utf8' '--enable-wddx' '--enable-zip' '--prefix=/opt/php53' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap-ssl' '--with-imap=/opt/php_with_imap_client/' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash' '--with-mime-magic' '--with-mssql=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-png-dir=/usr' '--with-pspell' '--with-tidy' '--with-ttf' '--with-unixODBC=/usr' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--with-zlib-dir=/usr' '--enable-intl' '--with-gmp' '--with-sqlite'
    Server API CGI/FastCGI
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /opt/php53/lib
    Loaded Configuration File /opt/php53/lib/php.ini
    Scan this dir for additional .ini files (none)
    Additional .ini files parsed (none)
    PHP API 20090626
    PHP Extension 20090626
    Zend Extension 220090626
    Zend Extension Build API220090626,NTS
    PHP Extension Build API20090626,NTS
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    Zend Multibyte Support disabled
    IPv6 Support enabled
    Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
    Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

  • i have spoken to hostgator and they have php is 5.3 on domain but osticket is not seing it please help

    here is a line form error log in api folder

    [04-Jun-2014 06:44:01] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122

  • Did you do what I asked? "pull up a command prompt.  Type in php --version.  What does it report?"

    But now I knopw where your hosted it simply confirms my suspicions.  You are not using the right version of PHP, becaue theyhave multiple versions installed.  As your host for the path to PHP5.3.  Edit the first line of your pipe.php and change the first line to point to the right version.

    ie
    #!/usr/bin/php -q

    will change to:
    #!/usr/bin/What/your/host/tellsyou -q
  • hi ntozier
    here is shell report of php --version

    /home/btssn/public_html/ticket/api$ php --version
    PHP 5.2.17 (cli) (built: Jun  4 2012 12:32:19)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
        with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd., and
        with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies


    I will contact hostgator for my php 5.3 path
  • thanks for answer i have tried the following in my pipe.php file and none have worked.
    #!/opt/php53/bin/php –q and #!/opt/php53/lib -q
    when i run php --version is still says 5.2.17 in my .htaccess file the path to php 5.3 is /opt/php53/lib but on website it says The path to PHP 5.3 on shared & reseller servers is /opt/php53/bin/php so am confused ?
  • Here is update i have spoken to hostgator and they say path to php 5.3 is /opt/php53/bin/php
    i have tried all these combinations and none work:
    #!/usr/bin/php –q or #!/usr/bin/opt/php53/bin/php –q or #!usr/bin/opt/php53/lib –q or #!/opt/php53/bin/php –q or #!opt/php53/lib –q my pip.php and cron.php and .htaccess files all 755 access. I attach a sample of pipe.php and .htaccess

  • pipe.php file

    #!/usr/bin/opt/php53/bin/php –
    <?php
    /*********************************************************************
        pipe.php

        Converts piped emails to ticket. Just local - remote must use /api/tickets.email

        Peter Rotich <peter@osticket.com>
        Copyright (c)  2006-2013 osTicket
        http://www.osticket.com

        Released under the GNU General Public License WITHOUT ANY WARRANTY.
        See LICENSE.TXT for details.

        vim: expandtab sw=4 ts=4 sts=4:
    **********************************************************************/
    ini_set('memory_limit', '256M'); //The concern here is having enough mem for emails with attachments.
    @chdir(dirname(__FILE__).'/'); //Change dir.
    require('api.inc.php');

    //Only local piping supported via pipe.php
    if (!osTicket::is_cli())
        die('pipe.php only supports local piping - use http -> api/tickets.email');

    require_once(INCLUDE_DIR.'api.tickets.php');
    PipeApiController::process();
    ?>

  • .htaccess file

    # Use PHP 5.3
    AddType application/x-httpd-php53 .php


    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.*/api)

    RewriteRule ^(.*)$ %1/http.php/$1 [L]

    </IfModule>
    # Use PHP53 as default
    AddHandler application/x-httpd-php53 .php
    <IfModule mod_suphp.c>
        suPHP_ConfigPath /opt/php53/lib
    </IfModule>
  • error log

    [04-Jun-2014 06:44:01] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [04-Jun-2014 06:49:19] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [04-Jun-2014 07:04:04] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [04-Jun-2014 07:22:27] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 11:38:12] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:21:07] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:23:25] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:23:26] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:24:42] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:27:48] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [05-Jun-2014 13:29:26] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [06-Jun-2014 05:12:18] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122
    [06-Jun-2014 06:20:27] PHP Parse error:  syntax error, unexpected T_STATIC in /home/btssn/public_html/ticket/include/class.plugin.php on line 122

  • Change the first line of your pipe.php from the original:
     
    #!/usr/bin/php -q

    to the one that your host gave you.
    #!/opt/php53/bin/php -q

    If it does not work then the path that your host gave you is wrong.
    You can test it by pulling up a command prompt.  Type in /opt/php53/bin/php --version and hitting enter.
    If you something similar to the one you got just by running the same command originally.  The pipe.php you posted is wrong as you missed the trailing q.  Your .htaccess file has nothing to do with your command line, so I'm not real sure why your posting it.
  • Hi,

    Thank you for response, i posted the .htaccess file as the hosting company asked me to check php version there, I have typed in /opt/php53/bin/php --version and below is output: /home/btssn/public_html/ticket/api$ /opt/php53/bin/php --version
    PHP 5.3.28 (cli) (built: Jan 27 2014 18:21:59)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
        with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd., and
        with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

    This shows php 5.3 although i still get mail delivery error, i have corrected trailing and will post pipe.php file again. Hope we can resolve this time
  • pipe.php file:

    #!/opt/php53/bin/php -q
    <?php
    /*********************************************************************
        pipe.php

        Converts piped emails to ticket. Just local - remote must use /api/tickets.email

        Peter Rotich <peter@osticket.com>
        Copyright (c)  2006-2013 osTicket
        http://www.osticket.com

        Released under the GNU General Public License WITHOUT ANY WARRANTY.
        See LICENSE.TXT for details.

        vim: expandtab sw=4 ts=4 sts=4:
    **********************************************************************/
    ini_set('memory_limit', '256M'); //The concern here is having enough mem for emails with attachments.
    @chdir(dirname(__FILE__).'/'); //Change dir.
    require('api.inc.php');

    //Only local piping supported via pipe.php
    if (!osTicket::is_cli())
        die('pipe.php only supports local piping - use http -> api/tickets.email');

    require_once(INCLUDE_DIR.'api.tickets.php');
    PipeApiController::process();
    ?>


  • Are you sure?  Since you've updated the pipe.php with the 5.3 path have you deleted your error log and tried again. You reported that you were getting this:

    The following text was generated during the delivery attempt:

    ------ pipe to |/home/btssn/public_html/ticket/api/pipe.php

           generated by tickets@btssn ------

    <br />

    <b>Parse error</b>:  syntax error, unexpected T_STATIC in <b>/home/btssn/public_html/ticket/include/class.plugin.php</b> on line <b>122</b><br />

    And your still getting the EXACT same error?
  • Out of curiosity, after you upgraded you went and upgraded the plugins that you have installed too right?
  • yes,

    have deleted forwarder in cpanel and created again to /home/btssn/public_html/ticket/api/pip.php
    I have deleted error logs no new errors since 6th june.

    I still get this message :(


  • i just extracted all of the upload folder onto directory and then restored database by editing ost-config.php i did NOT upload scripts folder ?
  • I'm not sure if you answered my question about also upgrading the plugins you have installed...
  • i did not add any plugins ? as far i am aware i was running base ostickets from v1.6 then to 1.7.2 email piping was working until i upgraded to 1.8.3 and 1.9.1
  • should i download and install plugins there are 4 plugins on website, 2 for authentication and 2 for storage ?
  • Well I was just looking at the class.plugin.php to explore other possibilities and that section of the code is where it tries to make a list of the plugins that are installed.  So I thought that maybe you had installed one at some point or something.

    The error looks exactly what what happens when your not running php 5.3 though.... I've point this thread out to the devs.  It still looks to me like your not running php 5.3
  • i have attached output from outlook 2010
    piping.docx
    16K
This discussion has been closed.