Feature #6038
closedPHP 5.6.10 migration
0%
Description
Ref: https://hg.openindiana.org/upstream/oracle/userland-gate/file/d5eea6257d67/components/php
1. Add userland packages for PHP 5.6.10
2. Bump PHP-55 to PHP 5.5.26.
3. Decommission PHP-54 packages.
Updated by Predrag Zečević about 7 years ago
Hi,
is it possible to get this one compiled with openldap instead of very old Sun LDAP libraries?
phpinfo() from PHP 5.6.15 OI /hipster shows:
LDAP Support enabled
RCS Version $Id: ab663b156be320c3bba8a7267187105adc47361a $
Total Links 0/unlimited
API Version 2005
Vendor Name Sun Microsystems Inc.
Vendor Version 500
and as self compiled 5.6.14:
LDAP Support enabled
RCS Version $Id: ab663b156be320c3bba8a7267187105adc47361a $
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20442
All php LDAP functionality doesn't work (or I do not know how to use it) from OI PHP version (true for older ones too).
I might be wrong, but could not manage to get it working (for example DokuWiki authorization from LDAP, where LDAP server is variant of OpenLDAP one: 389-DS).
Regards.
Updated by Alexander Pyhalov about 7 years ago
Need more info. LDAP extension works for me with AD server.
$ cat test_ldap.php <?php $SearchFor="alp"; //What string do you want to find? $SearchField="samaccountname"; //In what Active Directory field do you want to search for the string? $LDAPHost = "my.ad.server"; //Your LDAP server DNS Name or IP Address $dn = "dc=domain,dc=suffix"; //Put your Base DN here $LDAPUser = "DOMAIN\alp"; //A valid Active Directory login echo "Password: "; system('stty -echo'); $LDAPUserPassword = trim(fgets(STDIN)); system('stty echo'); echo "\n"; $LDAPFieldsToFind = array("mail"); $cnx = ldap_connect($LDAPHost) or die("Could not connect to LDAP"); ldap_set_option($cnx, LDAP_OPT_PROTOCOL_VERSION, 3); //Set the LDAP Protocol used by your AD service ldap_set_option($cnx, LDAP_OPT_REFERRALS, 0); //This was necessary for my AD to do anything ldap_bind($cnx,$LDAPUser,$LDAPUserPassword) or die("Could not bind to LDAP"); error_reporting (E_ALL ^ E_NOTICE); //Suppress some unnecessary messages $filter="($SearchField=$SearchFor)"; $sr=ldap_search($cnx, $dn, $filter, $LDAPFieldsToFind); $info = ldap_get_entries($cnx, $sr); for ($x=0; $x<$info["count"]; $x++) { print($info[$x]["mail"][0]); echo "\n"; } if ($x==0) { print "Oops, $SearchField $SearchFor was not found. Please try again.\n"; } ?> $ php test_ldap.php Password: alp@sfedu.ru
Updated by Alexander Pyhalov about 7 years ago
Made PHP ldap extension to use OpenLDAP. https://github.com/OpenIndiana/oi-userland/commit/a17d0f9001b70a2b8ca6cea7d26e4c3ddc5f7e9c
Updated by Predrag Zečević about 7 years ago
Hi All,
Just to correct my problem description...
Actually, problem lies in use of ssl library: I guess Sun LDAP library is using something else (mozilla nss?), not openssl.
$ ldd /usr/php/5.6/extensions/ldap.so libldap.so.5 => /usr/lib/libldap.so.5 libc.so.1 => /lib/libc.so.1 libsasl.so.1 => /usr/lib/libsasl.so.1 libsocket.so.1 => /lib/libsocket.so.1 libnsl.so.1 => /lib/libnsl.so.1 libmd.so.1 => /lib/libmd.so.1 libnspr4.so => /usr/lib/mps/libnspr4.so libplc4.so => /usr/lib/mps/libplc4.so libnss3.so => /usr/lib/mps/libnss3.so libssl3.so => /usr/lib/mps/libssl3.so libmp.so.2 => /lib/libmp.so.2 libpthread.so.1 => /lib/libpthread.so.1 librt.so.1 => /lib/librt.so.1 libdl.so.1 => /lib/libdl.so.1 libnssutil3.so => /usr/lib/mps/libnssutil3.so libplds4.so => /usr/lib/mps/libplds4.so libthread.so.1 => /lib/libthread.so.1 libm.so.2 => /lib/libm.so.2
Our LDAP server uses TLS on port 636 (php connection: ldaps://ldap.server.com:636) and when using OI php (5.6 in this case, latest before change) i get "Could not bind", If I us self compiled PHP (OpenSSL + OpenLDAP):
$ ldd /opt/SFW/php/5.6/extensions/ldap.so libstdc++.so.6 => /usr/gnu/lib/libstdc++.so.6 libldap-2.4.so.2 => /opt/SFW/lib/libldap-2.4.so.2 liblber-2.4.so.2 => /opt/SFW/lib/liblber-2.4.so.2 libgcc_s.so.1 => /usr/gnu/lib/libgcc_s.so.1 libc.so.1 => /lib/libc.so.1 libm.so.2 => /lib/libm.so.2 libresolv.so.2 => /lib/libresolv.so.2 libnsl.so.1 => /lib/libnsl.so.1 libsocket.so.1 => /lib/libsocket.so.1 libsasl.so.1 => /usr/lib/libsasl.so.1 libssl.so.1.0.0 => /opt/SFW/lib/libssl.so.1.0.0 libcrypto.so.1.0.0 => /opt/SFW/lib/libcrypto.so.1.0.0 libmd.so.1 => /lib/libmd.so.1 libmp.so.2 => /lib/libmp.so.2 libcrypto.so.1.0.0 => /lib/libcrypto.so.1.0.0 libdl.so.1 => /lib/libdl.so.1 libgcc_s.so.1 => /usr/lib/libgcc_s.so.1
my php script (and dokuwiki pldapsearch plug-in) works fine!
OI opendlap also uses OpenSSL:
$ ldd /usr/bin/openldapsearch libldap-2.4.so.2 => /usr/lib/libldap-2.4.so.2 liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 libsasl.so.1 => /usr/lib/libsasl.so.1 libnsl.so.1 => /lib/libnsl.so.1 libc.so.1 => /lib/libc.so.1 libresolv.so.2 => /lib/libresolv.so.2 libsocket.so.1 => /lib/libsocket.so.1 libssl.so.1.0.0 => /lib/libssl.so.1.0.0 libcrypto.so.1.0.0 => /lib/libcrypto.so.1.0.0 libmd.so.1 => /lib/libmd.so.1 libmp.so.2 => /lib/libmp.so.2 libdl.so.1 => /lib/libdl.so.1 libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 libm.so.2 => /lib/libm.so.2
that is why I have asked this.
Regards
Updated by Alexander Pyhalov about 7 years ago
Have you tried latest OI php-ldap?
Updated by Predrag Zečević about 7 years ago
Hi Alexander,
not yet. But will soon as I update system with latest changes.
Thanks.
Updated by Predrag Zečević about 7 years ago
Alexander,
yes, it works fine now with OI php 5.6.15 compiled with opendlap.
Thank you.
Updated by Predrag Zečević about 7 years ago
Hi,
I have spotted (from output of PHPinfo() function that this might be compiled with apxs2 from Apache 2.2 (which is not default version):
Configure Command: '/jenkins/jobs/oi-userland/workspace/components/php-5_6/php-5.6.15/configure' '--prefix=/usr/php/5.6' '--includedir=/usr/php/5.6/include' '--sysconfdir=/etc/php/5.6' '--datadir=/var/php/5.6' '--mandir=/usr/php/5.6/share/man' '--localstatedir=/var/php/5.6' '--enable-fpm' '--with-config-file-path=/etc/php/5.6' '--with-config-file-scan-dir=/etc/php/5.6/conf.d' '--with-pear=/usr/php/5.6/share/PEAR' '--with-layout=PHP' '--with-zend-vm=CALL' '--with-cdb' '--with-kerberos' '--with-pcre-regex' '--with-gettext=shared' '--with-xmlrpc=shared' '--with-gd=shared' '--with-zlib=shared' '--with-openssl=shared' '--with-pdo-sqlite=shared' '--with-ldap=shared' '--with-bz2=shared' '--with-iconv=shared' '--with-tidy=shared' '--with-mhash=shared' '--with-mcrypt=shared' '--with-xsl=shared' '--with-curl=shared' '--with-readline=shared' '--with-pspell=shared' '--with-imap=shared' '--with-imap-ssl' '--with-jpeg-dir=/usr' '--disable-static' '--disable-dba' '--disable-debug' '--disable-libgcc' '--enable-dtrace' '--without-dbm' '--without-t1lib' '--enable-cli' '--enable-cgi' '--enable-shared' '--enable-filter' '--enable-gd-jis-conv' '--enable-short-tags' '--enable-pcntl' '--enable-shmop' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-simplexml' '--enable-hash' '--enable-session' '--enable-opcache' '--enable-bcmath=shared' '--enable-json=shared' '--enable-libxml=shared' '--enable-ctype=shared' '--enable-calendar=shared' '--enable-tokenizer=shared' '--enable-exif=shared' '--enable-dom=shared' '--enable-ftp=shared' '--enable-intl=shared' '--enable-pdo=shared' '--enable-mbstring=shared' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-wddx=shared' '--enable-zip=shared' '--bindir=/usr/php/5.6/bin' '--sbindir=/usr/php/5.6/bin' '--libdir=/usr/php/5.6/lib' '--libexecdir=/usr/php/5.6/libexec' '--with-apxs2=/usr/apache2/2.2/bin/apxs' 'CC=/usr/gcc/4.8/bin/gcc' 'CFLAGS=-m32 '-D_POSIX_PTHREAD_SEMANTICS'' 'LDFLAGS=-m32' 'CPPFLAGS=-I/usr/include/openldap' 'CXX=/usr/gcc/4.8/bin/g++' 'CXXFLAGS= '-m32''
NOTE use of
'--with-apxs2=/usr/apache2/2.2/bin/apxs'
Regards.
Updated by Alexander Pyhalov over 6 years ago
Do we want to drop php 5.4 packages? I suppose, most frameworks work fine even with php 5.6, but what about hand-written sites?
Updated by Alexander Pyhalov over 6 years ago
- Status changed from New to Resolved
PHP 5.4 and 5.5 were dropped.