Snipe-it: Function ldap_control_paged_result() is deprecated in php 7.4

Created on 13 Dec 2019  Â·  18Comments  Â·  Source: snipe/snipe-it

Please confirm you have done the following before posting your bug report:

Describe the bug
In build 4.8.0 (4186) with php 7.4, LDAP Sync no longer works because Function ldap_control_paged_result() is deprecated

To Reproduce
Steps to reproduce the behavior:

  1. Install php 7.4
    2.
    Expected behavior
    Expected LDAP Sync to work, but function has been deprecated and moved to ldap_search() instead.
    https://www.php.net/manual/en/migration74.deprecated.php

Server (please complete the following information):

  • Snipe-IT Version 4.8.0
  • OS: Centos 8
  • Web Server: Apache
  • PHP Version 7.4

Error Messages
LOG.info: ErrorException: Function ldap_control_paged_result() is deprecated in /var/www/snipe-it/app/Models/Ldap.php:289
Stack trace:

0 /var/www/snipe-it/app/Models/Ldap.php(289): IlluminateFoundationBootstrapHandleExceptions->handleError()

1 /var/www/snipe-it/app/Console/Commands/LdapSync.php(77): AppModelsLdap::findLdapUsers()

2 [internal function]: AppConsoleCommandsLdapSync->handle()

3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array()

4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): IlluminateContainerBoundMethod::IlluminateContainer{closure}()

Additional context

  • Is this a fresh install or an upgrade? fresh
  • What method you used to install Snipe-IT - manual git
stale

Most helpful comment

Hi,

I couldn't go back because of other PHP based applications. I decided to give it a try to disable the deprecation warning - of course this has to be handled with care. However, it worked very well.

In order to do this, just place a

error_reporting(E_ALL ^ E_DEPRECATED);

into file _app/Models/ldap.php_ on line 241 (in function findLdapUsers).

Don't forget to turn the errors on again by inserting

error_reporting(E_ALL);

at the end of the function, right before

return $results;

All 18 comments

I have the same issue. PHP v7.4 and Snipe-IT version 4.8.

I rolled back to 7.3 as a workaround, but hopefully this is a good heads up for v5

Sent from my iPhone

On Dec 17, 2019, at 2:08 AM, TobiasKrok notifications@github.com wrote:


I have the same issue. PHP v7.4 and Snipe-IT version 4.8.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@innocuoussoul how did you do that? Same error on WinServer and IIS

Uninstalled php 7.4 and installed 7.3

Sent from my iPhone

On Dec 19, 2019, at 2:27 PM, bruce2004x notifications@github.com wrote:


@innocuoussoul how did you do that? Same error on WinServer and IIS

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Friend, really thanks...I rolled back to 7.3 and LDAP now works.

Yep just hit this after upgrading my system.

I eventually managed to get it running by removing php7.4 and installing php7.3. However this resurrected another different bug. Php7.3 is unable to establish SSL protected sessions to MariaDB which is why we upgraded in the first place.

If I both have php7.3 for LDAP sync and turn off SSL for MySQL/MariaDB then it works.

Please fix it!

I can also confirm this is the fix. Just migrated to Win 2012R2 IIS server using PHP 7.4 and cannot sync ldap due to error. Rolled back to 7.3.14 and it works fine.

Hi,

I couldn't go back because of other PHP based applications. I decided to give it a try to disable the deprecation warning - of course this has to be handled with care. However, it worked very well.

In order to do this, just place a

error_reporting(E_ALL ^ E_DEPRECATED);

into file _app/Models/ldap.php_ on line 241 (in function findLdapUsers).

Don't forget to turn the errors on again by inserting

error_reporting(E_ALL);

at the end of the function, right before

return $results;

Hi,

I couldn't go back because of other PHP based applications. I decided to give it a try to disable the deprecation warning - of course this has to be handled with care. However, it worked very well.

In order to do this, just place a

error_reporting(E_ALL ^ E_DEPRECATED);

into file _app/Models/ldap.php_ on line 241 (in function findLdapUsers).

Don't forget to turn the errors on again by inserting

error_reporting(E_ALL);

at the end of the function, right before

return $results;

This workaround fixed this particular issue. Thanks!

How did you rollback to 7.3. on CentOS 7?

Are there any other workarounds?

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

Any chance we can update to php 7.4 yet?

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

Same problem here. I've upgraded Ubuntu to 20.04 and PHP was also updated to 7.4. The error occurs on syncing LDAP Users

minimally, it would be good to note in the installation instructions that PHP 7.4 is not currently supported (at least for LDAP)

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Neor5804 picture Neor5804  Â·  3Comments

mauroaltamura picture mauroaltamura  Â·  5Comments

snipe picture snipe  Â·  3Comments

alextheberge picture alextheberge  Â·  4Comments

Rungea96 picture Rungea96  Â·  4Comments