I just setup a new server with following specs:
Server Information
osTicket Version v1.11 (7b1eee8) — Up to date
Web Server Software Apache/2.4.18 (Ubuntu)
MySQL Version 5.7.25
PHP Version 5.6.39-1+ubuntu16.04.1+deb.sury.org+1

I've got SMTP setup with SASL, no problem there, I can send and I see email flowing in through the email logs.

I setup the osticket email accounts in the 'alises' config and am pointing them to the pipe.php file as instructed.

But now the mail.log is pull these PHP errors:

Remote Server returned '554 5.3.0 < #5.3.0 x-unix; PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/osticket/upload/include/class.osticket.php on line 439 PHP Stack trace: 
PHP 1. {main}() /var/www/html/osticket/upload/api/pipe.php:0 
PHP 2. require() /var/www/html/osticket/upload/api/pipe.php:19 
PHP 3. require_once() /var/www/html/osticket/upload/api/api.inc.php:23 
PHP 4. require() /var/www/html/osticket/upload/main.inc.php:23 
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/html/osticket/upload/include/mysqli.php:28 Stack trace: #0 /var/www/html/osticket/upload/bootstrap.php(190): db_connect('localhost', 'osticket', 'password', Array) #1 /var/www/html/osticket/upload/main.inc.php(28): Bootstrap::connect() #2 /var/www/html/osticket/upload/api/api.inc.php(23): require_once('/var/www/html/o...') #3 /var/www/html/osticket/upload/api/pipe.php(19): require('/var/www/html/o...') #4 {main} thrown in /var/www/html/osticket/upload/include/mysqli.php on line 28>'

Any ideas? Is this a bug?

Its weird, mysqli_init() should be a native PHP function.

Its installed:

System	Linux acct 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64
Server API	Apache 2.0 Handler
Virtual Directory Support	disabled
Configuration File (php.ini) Path	/etc/php/5.6/apache2
Loaded Configuration File	/etc/php/5.6/apache2/php.ini
Scan this dir for additional .ini files	/etc/php/5.6/apache2/conf.d
Additional .ini files parsed	/etc/php/5.6/apache2/conf.d/10-mysqlnd.ini, /etc/php/5.6/apache2/conf.d/10-opcache.ini, /etc/php/5.6/apache2/conf.d/10-pdo.ini, /etc/php/5.6/apache2/conf.d/15-xml.ini, /etc/php/5.6/apache2/conf.d/20-apcu.ini, /etc/php/5.6/apache2/conf.d/20-calendar.ini, /etc/php/5.6/apache2/conf.d/20-ctype.ini, /etc/php/5.6/apache2/conf.d/20-dom.ini, /etc/php/5.6/apache2/conf.d/20-exif.ini, /etc/php/5.6/apache2/conf.d/20-fileinfo.ini, /etc/php/5.6/apache2/conf.d/20-ftp.ini, /etc/php/5.6/apache2/conf.d/20-gd.ini, /etc/php/5.6/apache2/conf.d/20-gettext.ini, /etc/php/5.6/apache2/conf.d/20-iconv.ini, /etc/php/5.6/apache2/conf.d/20-imap.ini, /etc/php/5.6/apache2/conf.d/20-intl.ini, /etc/php/5.6/apache2/conf.d/20-json.ini, /etc/php/5.6/apache2/conf.d/20-ldap.ini, /etc/php/5.6/apache2/conf.d/20-mbstring.ini, /etc/php/5.6/apache2/conf.d/20-mysql.ini, /etc/php/5.6/apache2/conf.d/20-mysqli.ini, /etc/php/5.6/apache2/conf.d/20-pdo_mysql.ini, /etc/php/5.6/apache2/conf.d/20-phar.ini, /etc/php/5.6/apache2/conf.d/20-posix.ini, /etc/php/5.6/apache2/conf.d/20-readline.ini, /etc/php/5.6/apache2/conf.d/20-shmop.ini, /etc/php/5.6/apache2/conf.d/20-simplexml.ini, /etc/php/5.6/apache2/conf.d/20-sockets.ini, /etc/php/5.6/apache2/conf.d/20-sysvmsg.ini, /etc/php/5.6/apache2/conf.d/20-sysvsem.ini, /etc/php/5.6/apache2/conf.d/20-sysvshm.ini, /etc/php/5.6/apache2/conf.d/20-tokenizer.ini, /etc/php/5.6/apache2/conf.d/20-wddx.ini, /etc/php/5.6/apache2/conf.d/20-xdebug.ini, /etc/php/5.6/apache2/conf.d/20-xmlreader.ini, /etc/php/5.6/apache2/conf.d/20-xmlwriter.ini, /etc/php/5.6/apache2/conf.d/20-xsl.ini

And here:

MysqlI Support	enabled
Client API library version	mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
Active Persistent Links	0
Inactive Persistent Links	0
Active Links	0

Do I need to upgrade to PHP 7.0+?

Ok for whatever reason mysqli for PHP-5.6 was installed an enabled, but whenever I did a phpenmod mysqli, it told me it couldn't find it for PHP 7.3?

So I did an apt-get install php7.3-mysqli and it installed it and now the error is no longer occurring.

In all rights, it seems like it should be working just fine e.g.:

Feb 26 10:19:01 acct postfix/qmgr[23422]: B2405121163: removed
Feb 26 10:19:55 acct postfix/smtpd[47689]: connect from anvexch1.domain.com[10.1.10.77]
Feb 26 10:19:55 acct postfix/smtpd[47689]: D866F121163: client=anvexch1.domain.com[10.1.10.77]
Feb 26 10:19:55 acct postfix/cleanup[47692]: D866F121163: message-id=<e16b9a574f7545f8bc5ae7df6dadc6de@domain.com>
Feb 26 10:19:55 acct postfix/qmgr[23422]: D866F121163: from=<user@domain.com>, size=6023, nrcpt=1 (queue active)
Feb 26 10:19:55 acct postfix/smtpd[47689]: disconnect from anvexch1.domain.com[10.1.10.77] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Feb 26 10:19:56 acct postfix/local[47693]: 
D866F121163: to=<osa@acct.domain.com>, relay=local, delay=0.18, 
delays=0.01/0/0/0.17, dsn=2.0.0, 
status=sent (delivered to command: /var/www/html/osticket/upload/api/pipe.php)

But nothing is showing up in the Ticket queue on the system?

I always post on here and solve my own answer, but at least it'll do someone else some good.

Yeah so for whatever reason, my server also had 7.0+ versions of PHP installed and it was causing weird issues.

So I made sure I had mysqli installed for php5.6

apt-get install php5.6-mysqli

I then checked my php version

php -v

Noticed it was using v7.3, so I then I ran a extremely useful PHP update config command I was not familiar with:

update-alternatives --config php

This should let you choose what version you want to use.
I then made sure the mysqli mod was enabled:

phpenmod mysqli

Then restarted the apache2 server

service apache2 restart

And now its working fine.

Sorry for the BS forum post. Hopefully this will resolve someone elses issues.

Make sure pipe.php has the correct permissions as well should be in the postfix group and owned by www-data and have the correct read-write perms.

Make sure to insert your user accounts into the alias file in /etc/aliases, as follows:

# See man 5 aliases for format
postmaster:    root
osa:           "|/var/www/html/osticket/upload/api/pipe.php"
osaccounting:  "|/var/www/html/osticket/upload/api/pipe.php"
osap:         "|/var/www/html/osticket/upload/api/pipe.php"
oscgajdzik:    "|/var/www/html/osticket/upload/api/pipe.php"
osinsurancerequest: "|/var/www/html/osticket/upload/api/pipe.php"
osramorales:   "|/var/www/html/osticket/upload/api/pipe.php"

Obviously change the username (on the left) and the path (on the right) accordingly based on your server setup.

And I cant stress this enough if you're using Postfix, you NEED TO RUN:

newaliases

Otherwise Postfix will not take into consideration any changes you have made in the 'aliases' configuration file.

Other troubleshooting steps:
-CHECK YOUR LOG FILES -> /var/log/mail.log
-Create a php file you can navigate to on your folder with the following code inside:

<?php
phpinfo();
?>

When you go to that page, it should display all the PHP information on and about your server.
Make sure to remove this file once you're done troubleshooting as it is a huge security risk.

You can close this mods! Thanks for giving me a place to vomit my problems and thoughts.

No worries @Pietro_Aretino I would much rather someone post (and then post their own solution) than not post at all. This way everyone else can reference the post and hopefully it will help someone. ?

ntozier changed the title to [resolved] pipe.php broken?.
Write a Reply...