Hello all,
I'm attempting to set up local email piping and I'm seeing the following mysqli error in my maillog when invoking the pipe:
Jun 12 20:35:14 ml20 postfix/local[2271585]: 5CB92724BAC:
to=<support@localhost>,
orig_to=<support-bogus@t.unidata.ucar.edu>,
relay=local,
delay=0.12,
delays=0.01/0.01/0/0.1,
dsn=5.3.0,
status=bounced (Command died with status 255: "/opt/php/bin/php -q /data/osticket/upload/api/pipe.php".
Command output: PHP Fatal error: Uncaught mysqli_sql_exception: No such file or directory in /data/osticket/upload/include/mysqli.php:69
Stack trace: #0 /data/osticket/upload/include/mysqli.php(69): mysqli->real_connect()
#1 /data/osticket/upload/bootstrap.php(217): db_connect()
#2 /data/osticket/upload/main.inc.php(28): Bootstrap::connect()
#3 /data/osticket/upload/api/api.inc.php(32): require_once('...')
#4 /data/osticket/upload/api/pipe.php(19): require('...')
#5 {main} thrown in /data/osticket/upload/include/mysqli.php on line 69 )
Pertinent information below. Any tips for troubleshooting this issue? I've been staring at this for the past couple of hours and I'm stumped. I'm hoping someone with sharp eyes can see what I'm doing wrong.
Thank you!
Postfix
We are using postfix and this is what our aliases file looks like:
support-bogus: support@localhost
support: "|/opt/php/bin/php -q /data/osticket/upload/api/pipe.php"
I can confirm the database of the postfix aliases files exists and is current:
-rw-r--r-- 1 root root 1206 Jun 12 19:46 aliases
-rw-r--r-- 1 root root 12288 Jun 12 20:31 aliases.db
osTicket
I changed the php path in pipe.php
to match the version of php we are using:
#!/opt/php/bin/php -q
<?php
...
Perms on everything under upload/
(bothfiles and direcrtories) are all 755. E.g:
-rwxr-xr-x 1 www www 1040 Oct 25 2023 api.inc.php
-rwxr-xr-x 1 www www 710 Oct 25 2023 cron.php
-rwxr-xr-x 1 www www 998 Oct 25 2023 http.php
-rwxr-xr-x 1 www www 37 Oct 25 2023 index.php
-rwxr-xr-x 1 www www 927 Jun 12 21:34 pipe.php
MySQL
We are using MyDQL 8.0.36 and I can confirm the osticket user is able to login with the credentials I set up:
$ /opt/mysql/bin/mysql -u osticket_user -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 217
Server version: 8.0.36 MySQL Community Server - GPL
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| osticketdb |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
PHP
We're using PHP 8.1.29. Here is my php module environment:
$ /opt/php/bin/php -m
[PHP Modules]
apcu
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
hash
iconv
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache