Sys Admin


If you’re struggling to get the LDAP extension to work in PHP and IIS6 then you may want to read on. In my situation both the web server and PHP were confirmed to be working fine and reading the correct php.ini. But even with the correct line enabled in the php.ini file, LDAP would refuse to show in phpinfo() output.

After some searching of my own, it turns out that IIS6 on Windows Server 2003 (possibly XP too) will not properly read the PATH variable. So if you add the path to your PHP directory to the end of PATH, the DLLs required are still not found. This looks to affect IIS6 specifically as filesystem calls to the same DLLs did find them.

The solution – add the path to your PHP install to the start or earlier in the PATH variable and restart IIS. In my experience you will now see the LDAP options appear in your phpinfo() output.

Interesting Stuff

Print Processor Updates for Windows Queues

A while back I wrote about a few little tools from Microsoft that allowed an easy way to create remote print queues. One of the things I didn’t realise then was that another handy tool exists (in the Server 2003 Resource Kit) called setprinter.exe that opens up a few more options.

We use a non-standard print processor at work to insert barcodes on certain output from SAP. So to set all the printers on the print server or just one to use the new print processor, we just run,

setprinter myserver 2 pPrintProcessor="SAP Barcode"
setprinter myserverprinter01 2 pPrintProcessor="SAP Barcode"

Lots of other properties can also be changed using setprinter.exe, pretty much everything other than security permissions and for that you can use another tool in the RK, subinacl.exe. To view the properties of a queue and what you can change, just cycle through the property groups 0-9 (that’s the 2 in the above commands).

for %i in (0 1 2 3 4 5 6 7 8 9) do setprinter -show myserverprinter01 %i