View Issue Details

IDProjectCategoryView StatusLast Update
2046Composrphpinfopublic2015-10-05 10:02
ReporterGuest Assigned ToGuest  
PriorityhighSeveritymajor 
Status resolvedResolutionfixed 
Summary2046: PHP ERROR [64] Cannot redeclare ldap_escape() in sources/cns_ldap.php
DescriptionMy Host proider has forced an update from phpv 5.4 to 5.6 and now when a new user tries to Join I get the following error
An error has occurred

PHP ERROR [64] Cannot redeclare ldap_escape() in sources/cns_ldap.php on line 66 (version: 9.0.20, PHP version: 5.6.13-hetz1, URL: /portal/pg/join/step3/index.php?redirect=http%3A%3Aslash%3A%3Aslash%3Afarsouthnet.com%3Aslash%3Aportal%3Aslash%3Apg%3Aslash%3Astart%3Aslash%3Aindex.php%3Fredirected%3D1)

Here is the stack trace:

The staff have been provided a ‘stack trace’ which may help them diagnose the problem.
Steps To ReproduceRun php 5.6 on the hosting server
connect to Composr site
click join
fil in fields and when click sae on bottom it gives the error.

I can roll back to PHP 5.4 till 9th Oct 2015 then the change will be permanent and I will not be able to roll back.

Existing validated users can login fine
Additional Informationrunning 9.0.20
TagsNo tags attached.
Attach Tags
Attached Files
Time estimation (hours)
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

Chris Graham

2015-09-29 16:07

administrator   ~3107

Automated response: LDAP not working on PHP 5.6

PHP now defines its own ldap_escape function. This hotfix renames our function to avoid a naming conflict.

Chris Graham

2015-09-29 16:07

administrator   ~3108

Fixed in git commit 7acad9f (https://github.com/chrisgraham/Composr/commit/7acad9f - link will become active once code pushed to github)

A hotfix (a TAR of files to upload) have been uploaded to this issue. These files are made to the latest intra-version state (i.e. may roll in earlier fixes too if made to the same files) - so only upload files newer than what you have already. Always take backups of files you are replacing or keep a copy of the manual installer for your version, and only apply fixes you need. These hotfixes are not necessarily reliable or well supported. Not sure how to extract TAR files to your Windows computer? Try 7-zip (http://www.7-zip.org/).

Guest

2015-10-05 10:00

reporter   ~3126

Thanks Chris

Seems php 5.6 has a built in function called ldap_escape, which was breaking the client authentication.

My workaround was to rename the function in the code.

All usage is confined to the source file cns_ldap.php. So I made a backup then edited the file and change all instances of:

ldap_escape
to
cns_ldap_escape

That Sorted out the issue and all is working fine.

Thanks for the files will update

Chris Graham

2015-10-05 10:02

administrator   ~3127

That's right, that's exactly what this fix does (except we used cms_ prefix not cns_).

Issue History

Date Modified Username Field Change