FreeBSD 13-1 RELEASE with PHP81 When attempting to start phpldapadmin, I am greeted with this FATAL ERROR message: Fatal error: Uncaught Error: Undefined constant "LDAP_DEREF_NEVER" in /usr/local/www/phpldapadmin/lib/config_default.php:387 Stack trace: #0 /usr/local/www/phpldapadmin/lib/functions.php(264): Config->__construct() #1 /usr/local/www/phpldapadmin/htdocs/index.php(116): check_config('/usr/local/www/...') #2 {main} thrown in /usr/local/www/phpldapadmin/lib/config_default.php on line 387
According to documentation (https://www.php.net/manual/en/ldap.constants.php) such errors suppose that php-ldap is not installed on system. php81 changed it's beahavior about modules? Are you running PLA with nginx/php-fpm? If yes you have to restart php-fpm to load new installed modules
(In reply to Krzysztof from comment #1) apache24 with the following php ports installed: mod_php81-8.1.7 PHP Scripting Language (8.1.X branch) php81-8.1.7 PHP Scripting Language (8.1.X branch) php81-bz2-8.1.7 The bz2 shared extension for php php81-ctype-8.1.7 The ctype shared extension for php php81-filter-8.1.7 The filter shared extension for php php81-gd-8.1.7 The gd shared extension for php php81-gettext-8.1.7 The gettext shared extension for php php81-iconv-8.1.7 The iconv shared extension for php php81-ldap-8.1.7 The ldap shared extension for php php81-mbstring-8.1.7 The mbstring shared extension for php php81-mysqli-8.1.7 The mysqli shared extension for php php81-session-8.1.7 The session shared extension for php php81-xml-8.1.7 The xml shared extension for php php81-xmlwriter-8.1.7 The xmlwriter shared extension for php php81-zip-8.1.7 The zip shared extension for php php81-zlib-8.1.7 The zlib shared extension for php phpMyAdmin5-php81-5.2.0 Set of PHP-scripts to manage MySQL over the web phpldapadmin-php81-1.2.6.3_1 PHP application to administer LDAP over the web suphp-php81-0.7.2_2 Securely execute PHP scripts under Apache
(In reply to Gerard Seibert from comment #2) $ php -m | grep ldap should return ldap try to run phpinfo() and see that ldap module is "activated" in mod_php If both checks will return succes it means that I have to check and consult with PLA developer what could be a problem.
Created attachment 234698 [details] Output from phpinfo() Complete output from the phpinfo() function
cd /usr/local/www/phpldapadmin/htdocs php index.php and the result is...
Created attachment 234708 [details] Output from the htdoc directory: php index.php
I removed and reinstalled phpldapadmin and php81. Now, phpldapadmin starts (sort of), but it issues error messages, and I cannot log in. View the two screenshots attached here and tell me what you think. The titles are pretty much self-explanatory. The second screen appears when I try to log in. https://seibercom.net/images/OpeningScreen.png https://seibercom.net/images/SecondScreen.png I don't know 'php', so there isn't much I can do to debug this phenomenon. Under FreeBSD 11.4, I never had any problems at all.
So... It is very difficult to write php apps and follow everything that is changing between php versions (ie. 7.x, 8.x). Very quick searching with Google shows that's common problem with trim function. So it seems that PLA is not compatible with php 8.1+ (for now).
Pleas check it: https://github.com/leenooks/phpLDAPadmin/pull/149
(In reply to Krzysztof from comment #8) It doesn't work with php-8.0 either. I guess I will have to find another app to handle my needs. There is no way I am downgrading to 7.4
(In reply to Gerard Seibert from comment #10) No. I've made some patches (a month ago?), so I can confirm that with php80 it works. I've migrated a few servers to php80 and PLA is working very good. Telling the truth I'm using nginx+ pgp-fpm, but maybe there is problem with php settings...
(In reply to Krzysztof from comment #11) I can confirm that it does not work with apache24 on a FreeBSD 13.1 system with either php81 0r php80. It works fine on FreeBSD 11.4 with php74. I know virtually nothing about PHP so I cannot really be of any assistance to you.
OK. So I suggest to close this bug as we know why PLA is not working.
(In reply to Krzysztof from comment #13) Might I suggest that you put some sort of notification that phpldapadmin does not work under php80 or php81 with apache24 so that potential users will not waste their time attempting to install it? Better yet, just pull the port until you have had time to correct and properly test the port before reissuing it. In any case, I would like to be kept informed if and when the port is actually serviceable.
*** Bug 265135 has been marked as a duplicate of this bug. ***
OK. So I;ve made additional patches which support php81+ These additional potches should be implemented after patches which exist in files/ subdir now - some of files should be patched twice. Because these patches should be added only for php81+, so I will be very happy is someone will help how to modify Makefile. I've found https://docs.freebsd.org/en/books/porters-handbook/slow-porting/#slow-patch which suggests how to add extra patches in case of option. But I'm not sure how to implement these patches only for php81 and php82. Thanks a lot for any suggestions and help
Please close this bug. I've made a new one with patch (bug#266678).
(In reply to Krzysztof from comment #17) I will be thrilled to close this bug report once the port is updated with your patch, and I can install and test it myself.
(In reply to Gerard Seibert from comment #18) This PR (bug report) is blocker for commit of changes. I will check if it is possible to remove "blocker" from new bug report.
(In reply to Krzysztof from comment #19) OK, so bug #266678 is changed and it does not depend on this bug report. I hope that patch will be commited soon and you will be able to work with PLA and php81. As I wrote earlier (or on private message) it was tested with php82 also and there was no problems reported.
This bug maybe closed because bug#266678 is awaiting for commit to ports tree. And bu#266678 cantains solution for this one.
A patch to bug #266678 is committed. Please verify that it fixes your issue and report back so I can close this issue.
(In reply to Ronald Klop from comment #22) Well, bug#266678 was updated because I missed some fixes. But there is new bug#268135 which shows my mistake. I think one of these bugs should be closed as "duplicated"? I hope new patch from bug#266678 will be committed so all three bugs will be closed :-)))
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=05adb0bbb787e824fd84aa7aed170182a55268e7 commit 05adb0bbb787e824fd84aa7aed170182a55268e7 Author: Krzysztof <ports@bsdserwis.com> AuthorDate: 2022-12-08 09:23:03 +0000 Commit: Ronald Klop <ronald@FreeBSD.org> CommitDate: 2022-12-12 10:36:10 +0000 net/phpldapadmin: additional fix to support for php81+ PR: 266678 268135 264672 Approved by: rene (mentor) Differential Revision: https://reviews.freebsd.org/D37633 net/phpldapadmin/Makefile | 2 +- .../files/patch-lib_AttributeFactory.php | 7 ++++- net/phpldapadmin/files/patch-lib_PageRender.php | 29 ++++++++++++++++++ net/phpldapadmin/files/patch-lib_Tree.php | 9 ++++++ net/phpldapadmin/files/patch-lib_common.php | 11 +++++++ net/phpldapadmin/files/patch-lib_ds__ldap.php | 35 ++++++++++++++++++++-- net/phpldapadmin/files/patch-lib_ds__ldap__pla.php | 27 +++++++++++++++++ net/phpldapadmin/files/patch-lib_functions.php | 29 ++++++++++++++++++ net/phpldapadmin/files/patch-lib_xmlTemplates.php | 9 ++++++ 9 files changed, 154 insertions(+), 4 deletions(-)
And can you also confirm if this is fixed by the latest commit to bug #266678?
I suggest to close this bug as bug#268349 will be committed.
bug #268349 is committed