Well.Done (c) Radek Hulán [EN]

Zend Server CE (PHP 5.3) with SQL Server driver

18.09.2009

Running PHP applications on IIS is a very good idea especially since PHP 5.3 release, thanks to close cooperation between Microsoft and Zend, which brought us many Zend engine optimizations on Windows. PHP 5.3 can also (and finally) be compiled natively in Visual Studio 2008 or 2005, unlike old PHP releases which required Visual C++ 6.0 (released in 1998).

PHP on IIS is always using FastCGI interface, and should be combined with bytecode pre-compiler and code optimizer like Zend Optimizer+.  Zend Optimizer+ is part of PHP distribution from Zend, and is available free-of-charge as Zend Server Community Edition.

Running PHP on Windows also means you can use SQL Server 2008 database instead of (slow and unstable in my experience) MySQL.

Microsoft offers SQL Server Driver 1.1 for PHP on Codeplex, which is currently the best driver (considering both functionality and speed) to use for PHP <-> SQL Server 2008 communication.

There is one problem though. Zend Server CE is compiled using Visual Studio 2005 (VC8), while SQL Server Driver binaries are available only in VC6 or VC9. Unfortunately, VC9 extensions and VC8 PHP do not mix together. Fortunately, SQL Server driver source code is available on Codeplex, so you can easily compile it yourself.

Source code and compilation tools you need

category: PHP - permalink - comment: 1 [10.10.09 11:41]

html2pdf - convert your XHTML to PDF easily

15.07.2007

I've created html2pdf PHP class, which allows one-click conversion of XHTML to PDF. It is an extension of FPDF class, found on http://www.fpdf.org.

Basic HTML2PDF features:

  • support for bold text, italics, underlined text.
  • support for headlines <h1>, <h2>, <h3> and <h4>.
  • support for linked and embedded images.
  • basic support for tables.
  • full support for lists <li>.
  • full support for <blockquote>.
  • support for pseudo-tags <red>, <blue>.
  • <pre> will be displayed using Courier font, other text with Times New Roman font.
  • support for <br>, <br /> and <p>.
  • support for <hr> and <hr />.
  • exported PDF filename is created by ascii characters of article title.
  • temporary files are deleted after 60 minutes.
  • document header is created with article title, article URI, author, and publishing date.
  • document footer is created with current and total page numbers.
  • built-in support for iconv (character conversions).
  • supplied fonts Times a Courier, in CP1250 encoding (can be used for text in iso-8859-1, iso-8859-2, cp1250, and cp1252, with iconv).
category: PHP - permalink - comments: 5 [21.02.08 20:00]