LdapRecord-Laravel: [Support] Slow php artisan commands
Environment (please complete the following information):
- LDAP Server Type: ActiveDirectory
- PHP Version: 7.4
Describe the bug:
When this package is installed all php artisan
commands are extremely slow even the artisan command on its own to list commands, if I remove this package from composer run update and then run php artisan
the command is back to normal speed
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (13 by maintainers)
Commits related to this issue
- Only initialize the LDAP connection during the connection attempt https://github.com/DirectoryTree/LdapRecord-Laravel/issues/235 — committed to DirectoryTree/LdapRecord by stevebauman 3 years ago
Okay, I’ve just pushed a new release v2.4.5 that resolves this issue.
I have moved LDAP connection initialization into the actual connection attempt, rather than the instantiation of the
Connection
class itself. This will prevent this issue from occurring on users machines if their LDAP install has this issue.Thank you @jsandfordhughes and @bcalik! Really appreciate your time and feedback.
@stevebauman Thank you very much for taking time on this, much appreciated.
Hi @bcalik,
Sounds like you have a buggy LDAP installation on your system.
If you have published the
config/ldap.php
configuration file, then a newConnection
instance will be instantiated for however many connections you have inside of the configuration file.Here’s where the connections are loaded from the configuration file:
https://github.com/DirectoryTree/LdapRecord-Laravel/blob/1a355537f04fa091799898a9c532c6acb9b51d23/src/LdapServiceProvider.php#L82-L90
https://github.com/DirectoryTree/LdapRecord-Laravel/blob/1a355537f04fa091799898a9c532c6acb9b51d23/src/LdapServiceProvider.php#L97-L108
Then, here’s where
ldap_set_option
is being called:https://github.com/DirectoryTree/LdapRecord/blob/2d1c4d71dd900b2f8245a6e32f67274795fac8a2/src/Connection.php#L185-L192
By default, the configuration file comes with a single non-existing connection configured – for convenience. Simply remove all the connections, or define them a different way, if you have issues in your environment with your LDAP installation.
LDAP is your problem. Not this package.
Hi Steve,
Sorry for the late reply. Tried loads of stuff including upgrading to Big Sur. Still had the same issues. Ended up doing a fresh install of Big Sur and the issue has gone away. Must of been some Dodgy openldap extension or something.
Thanks for your help and the great package!
👍