Welcome!

Adobe Flex Authors: Matthew Lobas, PR.com Newswire, Shelly Palmer, Kevin Benedict

Related Topics: Adobe Flex

Adobe Flex: Article

Configuring and Testing PHP Servers for XSL Support

Transformations in a snap

To check if the configuration went smoothly, read the section Testing PHP 4.3 Servers.

Testing PHP 4.3+ Servers
The first proof of a successful installation is that your web server doesn't throw any errors after restarting. To check if everything went smoothly, load the PHP test page in your browser. You should see a section similar to the following image:

Check if these settings are present and enabled:

  • DOM/XML.
  • DOM/XSLT.
  • libxslt.
  • libxml.
  • zlib (for Mac OS).
For libxml and libxslt, only the version number may be listed (instead of the enabled/disabled status); this indicates they are present on your server.

Congratulations! Your server is now prepared for server-side development using XML and XSL.

Configuring PHP 5 Servers
On PHP 5 application servers, XML and XSL support has been greatly improved:

  • Server-side XSL transformations are a lot faster.
  • XML functions are W3C compliant.
  • XML functionality is usually built-in and enabled by default.

    Here is what you need for server-side XSL development on PHP 5:

  • DOM extension, which, in turn, requires libxml2.
  • XSL extension, which, in turn, requires libxslt.
The lixml2 and libxslt libraries by the Gnome project are usually built-in for Windows, so you don't need to worry about them. You may need to compile these libraries into your PHP installation on Linux-based systems, although this is unlikely in most cases. Go to the section corresponding to your operating system for detailed configuration instructions.

Configuring PHP 5 Servers on Windows
The following instructions assume you have already installed a web server with PHP language support on a computer running Windows. Fortunately, there are a lot of free tools on the Internet that help you install and configure a web server automatically. My personal favorite is WAMP Server, which also sets up a MySQL server, phpMyAdmin and SQLiteManager, in addition to Apache and PHP. For detailed instructions on installing WAMP Server, visit this web page.

Before proceeding with the configuration instructions, check if the required libraries are not already enabled on your server by loading the PHP test page in your browser.

As of PHP 5.0, libxml and libxslt libraries, and DOM extension are built in the PHP installation. The XSLT extension is also included by default, but may be disabled in your particular server configuration. To enable the XSLT extension on Windows, follow these instructions:

  • Locate the php.ini configuration file for your current PHP installation (usually in C:\Windows\) and open it using any text editor (such as Notepad).
  • Note: You can find out where the PHP configuration file (php.ini) is located on your system by loading the PHP test page containing the server information in your browser. Look for the Configuration File Path setting:
  • Search the following line:
  • ;extension=php_xsl.dll
  • and uncomment it by removing the ; character.
  • Save the php.ini file.
  • Restart your web server.
To check if the configuration went smoothly, read the section Testing PHP 5 Servers.

Configuring PHP 5 Servers on Linux
The following instructions assume you have already installed a web server with PHP language support on a computer running Linux. Before proceeding with the configuration instructions, check if the required libraries are not already enabled on your server by loading the PHP test page in your browser.

As of PHP 5.0, libxml and libxslt libraries, and DOM extension are built-in in the PHP installation. The XSLT extension is also included by default, but may be disabled in your particular server configuration. To enable the XSLT extension on Linux, follow these instructions:

  • Configure PHP with XSL support. To do that, execute the following commands, in this sequence:
  • ./configure \
  • --prefix=/usr/local/php \
  • --with-config-file-path=/usr/local/php \
  • --with-apxs=/usr/sbin/apxs \
  • --with-libxml-dir=/usr
  • --with-xsl=/usr

    Note: The flags used above only enable XSL support. Add any other flags that might be necessary for your own configuration, such as MySQL support, LDAP, FTP, and so on. Also, the path to your current PHP installation may be different than /usr/local/php, depending on your settings or the Linux/Unix version you are using.

  • Compile PHP:
  • make
  • Install PHP:
  • make install
  • estart your web server.
To check if the configuration went smoothly, read the section Testing PHP 5 Servers.

Configuring PHP 5 Servers on Mac OS X
The following instructions assume you have already installed a web server with PHP language support on a computer running MAC OS X. In the default configuration, the Apache web server is installed, but PHP support is disabled. To learn how to enable it, read the article by James Pelow.

Before proceeding with the configuration instructions, check if the required libraries are not already enabled on your server by loading the PHP test page in your browser.

You can also download a package that will install PHP 5.04 (as of writing this article) with default support for XML and XSLT from the entropy.ch website.

  • If libxml2 is already enabled, you can skip steps 1-7.
  • If both libxml2 and libxslt are already installed, but XSLT support is not enabled in your PHP installation, you can skip steps 1-12.
  • Download the latest source code version of the libxml2 library from the Gnome Project website.
  • Extract the library to a folder of choice, using either StuffIt Expander, or the tar command line utility:
  • tar xzvf libxml2-2.6.20.tar.gz
  • Open a Terminal window and navigate to the created folder.
  • Configure the libxml2 library with the following command:
  • ./configure ­with-prefix=/usr/local
  • Compile the library:
  • make
  • Install the libxml library on your server (you need to know the root password):
  • sudo make install
  • Download the latest source code version of the libxslt library from this website.
  • Extract the library to a folder of your choice, using either StuffIt Expander, or the tar command line utility:
  • tar xfz libxslt-1.1.14.tar.gz
  • Open a Terminal window and navigate to the created folder.
  • Configure the libxslt library, by issuing the following command:
  • ./configure --with-prefix=/usr/local \
  • --with-libxml-prefix=/usr/local /
  • --with-libxml-include-prefix=/usr/local/include \
  • --with-libxml-lib-prefix=/usr/local/lib
  • Compile the libxslt library:
  • make
  • Install the libxslt library on the server (you will need the root password):
  • sudo make install
  • You need to recompile PHP to enable XML and XSL support. Configure PHP with at least the following flags:
  • ./configure --with-xml ­with-zlib ­with-xslt

    Note: The flags used above only enable XSL support. Add any other flags that might be necessary for your own configuration, such as MySQL support, ldap, ftp, and so forth.

  • Compile PHP:
  • sudo make
  • Install the new PHP version. It will overwrite any previous version.
  • sudo make install
  • Restart your web server.
To check if the configuration went smoothly, read the section Testing PHP 5 Servers.

Testing PHP 5 Servers
The first proof of a successful installation is that your web server doesn't throw any errors after restarting. To check if everything went smoothly, load the PHP test page in your browser. You should see a section similar to the following image (Figure 4), if the DOM extension was successfully enabled.

If XSL support was successfully enabled, too, you should also see a section similar to this one:

Check if these settings are present and enabled:

  • DOM/XML.
  • libXML.
  • XSL.
  • libxslt.
For libxml and libxslt, only the version number may be listed (instead of the enabled/disabled status) ­ this indicates they are present on your server.

Congratulations! Your server is now prepared for server-side development using XML and XSL

Where to Go from Here
In this article, I have explained how to prepare your PHP server for server-side XSL transformations. Now you have everything you need to start exploring the new XSL authoring features in Dreamweaver 8. A good point to start my next article, Consuming a Remote RSS Feed with Dreamweaver 8.

You can also have a look at these additional resources:

  • The article Displaying XML Data walks you through using client-side XSL transformations to process XML documents.
  • John Skidgel shows how a restaurant website can use XML and XSL to display its daily menu, in his article, Creating XSLT Fragments for Server-Side Transformations.
  • Marc Liyanage's website offers a wealth of resources for MAC OS users.
  • The XSL FAQ
  • The Macromedia XML and XSL Developer Center Resource page

More Stories By Marius Zaharia

Marius Zaharia is the documentation manager at InterAKT Online, a developer of professional tools for dynamic web development. When he's not writing articles and tutorials to guide web developers, he enjoys learning new things and exploring new technologies. His interests range from web development to politics and avantgarde electronic music.

More Stories By Cristian Ivascu

Cristian Ivascu is a technical writer with InterAKT Online. He is a strong supporter of open-source software and a fan of Japanese culture and rock music.

Comments (4) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
thnx 04/25/06 08:40:25 AM EDT

thanks for the links

Marius 04/25/06 08:18:20 AM EDT

Sorry, first one is:
http://www.macromedia.com/devnet/dreamweaver/articles/xml_overview.html

Marius 04/25/06 08:17:06 AM EDT

Hi,
Here they are:
XML Overview: http://www.macromedia.com/devnet/dreamweaver/articles/xml_overview.html\

XSL Overview:
http://www.macromedia.com/devnet/dreamweaver/articles/xsl_overview.html

KF 04/20/06 10:14:33 AM EDT

This was a great article, it would have been nice to have links to the other two articles mentioned in the opening paragraph (XML Syntax and XSL overview). Is it possible to send me links to those articles?

Thanks in advance, KF

@ThingsExpo Stories
The BPM world is going through some evolution or changes where traditional business process management solutions really have nowhere to go in terms of development of the road map. In this demo at 15th Cloud Expo, Kyle Hansen, Director of Professional Services at AgilePoint, shows AgilePoint’s unique approach to dealing with this market circumstance by developing a rapid application composition or development framework.

ARMONK, N.Y., Nov. 20, 2014 /PRNewswire/ --  IBM (NYSE: IBM) today announced that it is bringing a greater level of control, security and flexibility to cloud-based application development and delivery with a single-tenant version of Bluemix, IBM's platform-as-a-service. The new platform enables developers to build ap...

"BSQUARE is in the business of selling software solutions for smart connected devices. It's obvious that IoT has moved from being a technology to being a fundamental part of business, and in the last 18 months people have said let's figure out how to do it and let's put some focus on it, " explained Dave Wagstaff, VP & Chief Architect, at BSQUARE Corporation, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4-6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
The major cloud platforms defy a simple, side-by-side analysis. Each of the major IaaS public-cloud platforms offers their own unique strengths and functionality. Options for on-site private cloud are diverse as well, and must be designed and deployed while taking existing legacy architecture and infrastructure into account. Then the reality is that most enterprises are embarking on a hybrid cloud strategy and programs. In this Power Panel at 15th Cloud Expo (http://www.CloudComputingExpo.com), moderated by Ashar Baig, Research Director, Cloud, at Gigaom Research, Nate Gordon, Director of T...
The Internet of Things is not new. Historically, smart businesses have used its basic concept of leveraging data to drive better decision making and have capitalized on those insights to realize additional revenue opportunities. So, what has changed to make the Internet of Things one of the hottest topics in tech? In his session at @ThingsExpo, Chris Gray, Director, Embedded and Internet of Things, discussed the underlying factors that are driving the economics of intelligent systems. Discover how hardware commoditization, the ubiquitous nature of connectivity, and the emergence of Big Data a...
SYS-CON Events announced today that Windstream, a leading provider of advanced network and cloud communications, has been named “Silver Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9–11, 2015, at the Javits Center in New York, NY. Windstream (Nasdaq: WIN), a FORTUNE 500 and S&P 500 company, is a leading provider of advanced network communications, including cloud computing and managed services, to businesses nationwide. The company also offers broadband, phone and digital TV services to consumers primarily in rural areas.
“In the past year we've seen a lot of stabilization of WebRTC. You can now use it in production with a far greater degree of certainty. A lot of the real developments in the past year have been in things like the data channel, which will enable a whole new type of application," explained Peter Dunkley, Technical Director at Acision, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that IDenticard will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. IDenticard™ is the security division of Brady Corp (NYSE: BRC), a $1.5 billion manufacturer of identification products. We have small-company values with the strength and stability of a major corporation. IDenticard offers local sales, support and service to our customers across the United States and Canada. Our partner network encompasses some 300 of the world's leading systems integrators and security s...
DevOps Summit 2015 New York, co-located with the 16th International Cloud Expo - to be held June 9-11, 2015, at the Javits Center in New York City, NY - announces that it is now accepting Keynote Proposals. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that produce software that is obsolete at launch. DevOps may be disruptive, but it is essential.
"People are a lot more knowledgeable about APIs now. There are two types of people who work with APIs - IT people who want to use APIs for something internal and the product managers who want to do something outside APIs for people to connect to them," explained Roberto Medrano, Executive Vice President at SOA Software, in this SYS-CON.tv interview at Cloud Expo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
Nigeria has the largest economy in Africa, at more than US$500 billion, and ranks 23rd in the world. A recent re-evaluation of Nigeria's true economic size doubled the previous estimate, and brought it well ahead of South Africa, which is a member (unlike Nigeria) of the G20 club for political as well as economic reasons. Nigeria's economy can be said to be quite diverse from one point of view, but heavily dependent on oil and gas at the same time. Oil and natural gas account for about 15% of Nigera's overall economy, but traditionally represent more than 90% of the country's exports and as...
The Internet of Things is a misnomer. That implies that everything is on the Internet, and that simply should not be - especially for things that are blurring the line between medical devices that stimulate like a pacemaker and quantified self-sensors like a pedometer or pulse tracker. The mesh of things that we manage must be segmented into zones of trust for sensing data, transmitting data, receiving command and control administrative changes, and peer-to-peer mesh messaging. In his session at @ThingsExpo, Ryan Bagnulo, Solution Architect / Software Engineer at SOA Software, focused on desi...
"At our booth we are showing how to provide trust in the Internet of Things. Trust is where everything starts to become secure and trustworthy. Now with the scaling of the Internet of Things it becomes an interesting question – I've heard numbers from 200 billion devices next year up to a trillion in the next 10 to 15 years," explained Johannes Lintzen, Vice President of Sales at Utimaco, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
"For over 25 years we have been working with a lot of enterprise customers and we have seen how companies create applications. And now that we have moved to cloud computing, mobile, social and the Internet of Things, we see that the market needs a new way of creating applications," stated Jesse Shiah, CEO, President and Co-Founder of AgilePoint Inc., in this SYS-CON.tv interview at 15th Cloud Expo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Gridstore™, the leader in hyper-converged infrastructure purpose-built to optimize Microsoft workloads, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Gridstore™ is the leader in hyper-converged infrastructure purpose-built for Microsoft workloads and designed to accelerate applications in virtualized environments. Gridstore’s hyper-converged infrastructure is the industry’s first all flash version of HyperConverged Appliances that include both compute and storag...
Today’s enterprise is being driven by disruptive competitive and human capital requirements to provide enterprise application access through not only desktops, but also mobile devices. To retrofit existing programs across all these devices using traditional programming methods is very costly and time consuming – often prohibitively so. In his session at @ThingsExpo, Jesse Shiah, CEO, President, and Co-Founder of AgilePoint Inc., discussed how you can create applications that run on all mobile devices as well as laptops and desktops using a visual drag-and-drop application – and eForms-buildi...
We certainly live in interesting technological times. And no more interesting than the current competing IoT standards for connectivity. Various standards bodies, approaches, and ecosystems are vying for mindshare and positioning for a competitive edge. It is clear that when the dust settles, we will have new protocols, evolved protocols, that will change the way we interact with devices and infrastructure. We will also have evolved web protocols, like HTTP/2, that will be changing the very core of our infrastructures. At the same time, we have old approaches made new again like micro-services...
Code Halos - aka "digital fingerprints" - are the key organizing principle to understand a) how dumb things become smart and b) how to monetize this dynamic. In his session at @ThingsExpo, Robert Brown, AVP, Center for the Future of Work at Cognizant Technology Solutions, outlined research, analysis and recommendations from his recently published book on this phenomena on the way leading edge organizations like GE and Disney are unlocking the Internet of Things opportunity and what steps your organization should be taking to position itself for the next platform of digital competition.
The 3rd International Internet of @ThingsExpo, co-located with the 16th International Cloud Expo - to be held June 9-11, 2015, at the Javits Center in New York City, NY - announces that its Call for Papers is now open. The Internet of Things (IoT) is the biggest idea since the creation of the Worldwide Web more than 20 years ago.
As the Internet of Things unfolds, mobile and wearable devices are blurring the line between physical and digital, integrating ever more closely with our interests, our routines, our daily lives. Contextual computing and smart, sensor-equipped spaces bring the potential to walk through a world that recognizes us and responds accordingly. We become continuous transmitters and receivers of data. In his session at @ThingsExpo, Andrew Bolwell, Director of Innovation for HP's Printing and Personal Systems Group, discussed how key attributes of mobile technology – touch input, sensors, social, and ...