Tag Archives: php

Doc5 Wiki Available for Download

Slightly behind with this post but I finally have a new release of Doc5 available for download.

New features include,

  • Full WYSIWYG editing and no more trying to get used to the markup. (Not that it was difficult but people are used to risch editors these days)
  • Complete redesign of the UI.
    Bootstrap makes for an easy to use, clean interface and I really like the design anyway.
  • Easier to use more finely grained permissions.
    Per user permissions for categories and pages and inheritance for pages.
  • Much better file management and easier to link files into pages.
  • Bug fixes and support for different databases with faster access.
  • HTML email templates.
    This will make it easier to extend and handle language translations in the future.

Debug PHP Function Calls

Logging errors can be very helpful as your code base becomes huge. But sometime it’s still difficult to find out what’s calling the function that’s giving the error. Wouldn’t it be nice if there was a way to see how you’d got to that function?

Well of course there’s a way in PHPdebug_backtrace. Just add something similar in a suitable place in your code and you’ll be able to find what functions were called.

$trace=debug_backtrace();
$caller = $trace[1]['function'];
// or just dump all the info
var_dump($trace);

LDAP in PHP on IIS6

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.

Running WordPress & PHP Behind ISA Proxy

Some things work well on their own but when mixed make your life hard. Things like Linux and PHP work very well. Microsoft ISA proxy also does a good job in a corporate MS environment. But making the two work together in a controlled environment can be an exercise in frustration.

In this post I’ll pass on the methods I found to get PHP and your Linux boxes talking out through a corporate ISA proxy server. You can then bring in RSS feeds, updates and other things in WordPress and use apt-get to update Ubuntu. Continue reading Running WordPress & PHP Behind ISA Proxy

Outlook Hates Line Breaks

If you’ve ever wondered why your plain text email message is randomly ignoring line breaks like n or rn then you’re not alone. I regularly use PHPMailer to send off automated emails and usually in plain text to keep it simple.

What Outlook 2003 (and 2002 and 2007 versions apparently) likes to do is be super helpful and remove what it regards as extra line breaks. It won’t be consistent either within a single mail or across many but it will make the content difficult to read. What you thought would be new lines will now be joined up in places and it seems to happen more often the further through the content you go.

There don’t seem to be many fixes for this issue but there are a few work arounds to help out.

  1. Turn off this “feature” in Outlook in the Tools»Options menu. Honestly I’m not sure what use it is anyway. Unfortunately you’d have to do this on all the recipient’s computers.
  2. Use HTML in your email rather than plain text. Depending on your content and need for complete accuracy, perhaps more time than it’s worth.
  3. Add twice the number of line breaks where you currently have them. This seems to help but now your email is rather full of white space and may be more difficult to read.

Other than changing email clients, which is pretty unlikely, that’s about it. If you know of other options to try and get Outlook to not remove line breaks, please leave a comment below. This Microsoft KB article explains which versions of Outlook are affected http://support.microsoft.com/kb/287816.

Installing a Windows Dev Box

In the interest of saving this for future reference, here’s is a general how-to for installing a Windows based Web development server.

The reason for running up a Windows server as opposed to the typical LAMP alternative on Windows was due to frustration. The older Ubuntu server I had just made it very difficult to install the versions of PHP and MySQL that I wanted.

Applications I used were:
Apache 2.0.55
PHP 4.4.2
MySQL 4.1.18
Subverison 1.3
Continue reading Installing a Windows Dev Box