-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of undefined constant FT_UID - assumed 'FT_UID #2604
Comments
Make sure it's also enabled in the console version of PHP: https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#9-configuring-cron-jobs (artisan freescout:check-requriements) |
Sorry, to re-open it. The php-imap c-client becomes more and more difficult to adapt to recent versions of the required libs (e.g. ssl). The software is not maintained for years (better a decade) now, and my provider is not willing to support this anymore. So I activated the new fetching library in .env via:
and I get the above error when the imap-c-client is not installed. The reason is, that the version of webklex/laravel-imap used in freescout implicitly still depends on a loaded c-client for imap (which seems to provide FT_UID). It looks quite like the file webklex/laravel-imap/src/config/imap.php, which throws the error, is version 1.3.0 (commit a5c09cd from 5 1/2 years ago). To sum it up: The error (Use of undefined constant FT_UID - assumed 'FT_UID' ) is caused by the use of an too old version of webklex/laravel-imap/ which implicitly relies on imap-c-client to provide FT_UID. When replacing
by
in vendors/weblex/laravel-imap/src/config/imap.php (at line 105), the new library seems to do the job it is supposed to do. I admit I do not have any module installed that uses the IMAP connection heavily, to judge whether any side effects might exist. A more recent imap implementation by webklex could be the way to go. And btw the web-installer requires imap-c-client and would not let you install under php8 without it even with the above fix in imap.php. Eventually I succeeded installing freescout from scratch by commenting out the IMAP requirement in config/installer.php beforehand. However I had to manually add |
Do you mean you can't enable PHP
What error do you see in this case? |
Exactly. My provider (the university computer center) is not willing to support that piece of software anymore. One argument is, that it gets increasingly out of sync with the current ssl-libs. The official source code at https://github.com/uw-imap/imap was checked in over 6 years ago and never changed since then. The last changes prior to that were probably adaptations to openssl 1.1. Even in https://www.php.net/manual/en/book.imap.php there is a warning that it is not thread safe and does not handle IMAP commands over POP well (the last is irrelevant to freescout) Some distributions stopped bundling it over the past 1-2 years (I know SuSE did, and I somewhere read that Mint kicked it out as well).
Not an error as such, but when the requirement that IMAP is present is not met, you cannot proceed with the installation. You might call that expected behaviour, but it keeps you from installing freescout using the laravel-imap-library. I had to comment the IMAP requirement out of the config/installer.php list, to get past that point and then manually changed .env. And as I said the web-installer does not even start without imap-c-client present due to the error above, when you use the latest version unmodified from freescout.net. |
It looks like it was specifically SuSE's decision to drop php-imap extension:
We'll just mention that it in the docs. |
So you are not going to do anything about it - apart from mentioning SuSE's point of view in the docs? Not even introducing the absolutely minor change I suggested for I am - to put it mildly - surprised. |
Yes, we'll keep |
I was not asking you to drop the |
It should be possible. |
I checked your Fix and it doesn't work on my side under php8, it still causes php to throw an exception for vendor/webklex/laravel-imap/src/config/imap.php, does it work for you (without a php-imap c-client extension)? |
Don't for get |
I did, that's why I asked whether it works on your side. The composer running under PHP8 without php-imap extension fails when finally running I think, the only way to solve the problem without using a later version of laravel-imap (I think at least 1.4.1), is to replace
by
in |
In a test environment, I installed |
It should be fixed now. |
I completed freescout setup and config mailbox on my VPS. When trying to send email to this mailbox, it's not working, email never reaches its destination. The same problem is with downloading email. I see in logs this error. There is the same error every minute. Any idea how could it be solved?
Undefined constant "FT_UID" {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Undefined constant "FT_UID" at /var/www/user2131/data/www/lr.it-crowd.com/vendor/webklex/laravel-imap/src/config/imap.php:105)
[stacktrace]
#0 /var/www/user2131/data/www/lr.it-crowd.com/vendor/webklex/laravel-imap/src/IMAP/Providers/LaravelServiceProvider.php(66): require()
#1 /var/www/user2131/data/www/lr.it-crowd.com/vendor/webklex/laravel-imap/src/IMAP/Providers/LaravelServiceProvider.php(51): Webklex\IMAP\Providers\LaravelServiceProvider->setVendorConfig()
#2 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): Webklex\IMAP\Providers\LaravelServiceProvider->register()
#3 /var/www/user2131/data/www/lr.it-crowd.com/overrides/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(89): Illuminate\Foundation\Application->register(Object(Webklex\IMAP\Providers\LaravelServiceProvider))
#4 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(561): Illuminate\Foundation\ProviderRepository->load(Array)
#5 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#6 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#7 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(296): Illuminate\Foundation\Application->bootstrapWith(Array)
#8 /var/www/user2131/data/www/lr.it-crowd.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(119): Illuminate\Foundation\Console\Kernel->bootstrap()
#9 /var/www/user2131/data/www/lr.it-crowd.com/artisan(62): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 {main}
"}
The text was updated successfully, but these errors were encountered: