Notes on Java, Solaris, PHP, LDAP…

November 17, 2007

PHP and LDAP, PHP debuggers

Filed under: Uncategorized — negev @ 11:24 pm
Tags: ,

26 Sep 07
Delete all values of an LDAP attribute in PHP
ldap_mod_del( $connection, $dn, array( 'attrib-name' => array() ) );

Copy a directory recursively and keep the symlinks- use cp -R
- not cp -r

Relative inclusion of files using include/require in PHP
from comments on When I'm dealing with a package that uses relative includes of its own, rather than modify all of their includes, I found it was easier to change PHP's working directory before and after the include, like so:

$wd_was = getcwd();

This way neither my includes nor theirs are affected; they all work as expected. Or:
ini_set(‘include_path’, (ini_get(‘include_path’).’;’.$SITEROOT_PATH));

PHP ldap_mod_del()
– it requires attribute values to be indexed by consecutive int keys starting at 0!

PHP debuggers
— installs OK on Mac OS X 10.4
— if you activate it in php.ini, then commandline PHP stops working!
— error traces refer to PHP sources with lines starting at 0, not starting at 1!

When updating/creating an LDAP object in PHP and you get a funny attribute value
– if the attribute schema is a DN to (any) object
– and if the attrib value shows up as [Root] in ConsoleOne of Novell eDirectory
– and if the attrib values shows as null/empty string in PHP ldap_search and commandline ldapserch
– then you saved/created the object passing PHP null as the value of that attribute to PHP ldap_mod_add()
– solution: remove PHP null values when creating a new LDAP object. If updating an existing LDAP object, remove any existing values of that attribute by ldap_mod_del()


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: