Wednesday, July 25, 2012

Enabling LDAP on XAMPP 1.8.0 for Active Directory on Windows XP


Recently I installed XAMPP 1.8.0 on Windows XP. The XAMPP Server was working fine after installation and the control panel has really been given a good, clean and detailed look.

One of my applications needed PHP's LDAP Module so I went into the php.ini file located at [Your Drive]:\xampp\php\php.ini. and simply un-commented the line:

extension=php_ldap.dll

After doing the above I saved the INI file and restarted Apache service from the XAMPP Control Panel only to find the warning:

Warning PHP Startup: Unable to load dynamic library '\xampp\php\ext\php_ldap.dll'
After a bit of Googling I found this solution on the XAMPP Support Forum:


  • Added  [Your Drive]:\xampp\php to the PATH environment variable.
  • Move the file: libsasl.dll, from  [Your Drive]:\xampp\php to  [Your Drive]:\xampp\apache\bin.
  • Restart Apache from XAMPP Control Panel

After this Apache successfully started without any warnings or errors and phpinfo() also reported the LDAP Module as running. Hope it will save your time and effort from searching, browsing and understanding what is written at the link below :)

Source: Use LDAP extension ? [XAMPP Support Forum]

CHEERS :D

Tuesday, May 1, 2012

Resetting an Auto Incremental Primary Key on SQL Server

Almost all of us create tables in SQL Server with auto incremental primary keys. After creating these tables we write programs which use these tables to place data in them. These programs under go a  lot of testing and thus place a lot of test data in these tables and in turn increment the value of such auto increment fields.

Once all the testing is said and done and you are all set to launch your program/application/software you empty the database/tables so that there is no dummy/test data. but the simple delete statement:

DELETE FROM [tableName];

only clears the data but does not reset the values of any auto increment  fields, this gives a sense of uncleanliness when you are delivering the product/project.

So to reset any auto incremental primary key in MS SQL Server 2008 user defined database tables use the following command after the DELETE statement above.

DBCC CHECKIDENT ("dbo.[tableName]", RESEED, 0);

After the command has executed the next value generated for the auto incremental primary key would be 1, hence the count has been reset, giving a sense of a fresh start or a new beginning. Now you can test a fresh or deliver it a fresh. As pizza companies say Oven Hot we developers can say Database Fresh :).

Happy resetting. :)