Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
PHP and WMI – Dig deep into Windows with PHP
Dec 24, 2013 @ 12:30:25

On the SitePoint PHP blog they've posted a new tutorial that "digs deep" into PHP on Windows with WMI, the Windows Management Instrumentation functionality - a web-based architecture information gathering system.

There are many devices (servers, desktops, laptops, tablets, phones, etc) running a Windows operating system. Many of us who live in the nix based world have to work in this OS, or if we don't, we will, sooner or later. Besides the regular tools we can expect from a *nix system (say Apache, PHP, MySQL, C/C++ compilers, etc), Windows offers a set of unique features not present in any other OS, and WMI is one of them. In this article, we will address the questions like: What is WMI? How to use WMI with PHP? We will have some minimal sample codes to go through the basic programming techniques.

He starts off the post briefly explaining what WMI is and what kinds of problems it solves. He shows you how to check if it's installed (it probably is on most recent Windows machines) and that it's enabled. He also shows how to configure the firewall to allow WMI connections and the library you'll need to get the PHP support functional (php_com_dotnet.dll). He then gets into what kind of information you can get from WMI including local hardware information, BIOS details and memory usage. Some simple code is included using the COM functionality to connect to the server and run a query.

tagged: windows wmi information tutorial introduction com

Link: http://www.sitepoint.com/php-wmi-dig-deep-windows-php

Juozas Kaziukenas' Blog:
How to use external libraries in PHP?
May 23, 2009 @ 20:26:09

As a part of his work for the WinPHP Challenge Juozas Kaziukenas looks at some of the external library types that you can use with your (Windows) PHP applications.

External libraries are useful for performance demanding tasks where PHP is simply too slow. Also PHP can work as front-end system for various back-end systems (where server doesn't provide any PHP supported communication types). I have written some posts about using .Net libraries in PHP so far, but there are some other choices available too.

He looks at the three types of library choices - PHP extensions, exec call. For what he wants to do, though, the COM objects are the best fit for the job.

tagged: external extension pecl com

Link:

An Phillips' Blog:
COM/.NET Interop in Zero PHP
Jan 29, 2009 @ 15:03:25

Ant Phillips looks a bit at some interoperability between the PHP and Project Zero when to comes to using the COM/.NET extension.

Zero doesn't currently support the COM/.NET extension in PHP. No matter though, there is a handy open source project called JACOB that bridges between Java and COM/.NET. In fact, there is an easier way to do this using a Groovy library called Scriptom. This is really just a friendly wrapper around JACOB to provide a better syntax for calling methods and accessing properties.

He also includes a quick introduction and howto on getting the functionality up and working in a Windows environment - download, add the JAR to your path, edit your php.ini and copy and paste some example code in to see it in action.

tagged: com net interoperability zero extension jacob scriptom

Link:

Developer Tutorials Blog:
Extracting text from Word Documents via PHP and COM
Mar 26, 2008 @ 12:02:06

In a recent blog post Akash Mehta showed how to reach into a Microsoft document (a Word file) and pull out the content inside via a PHP script.

Communicating via COM in PHP is easy as ever; especially for people coming from a VB background where executing complex tasks in MS-applications is a piece of cake, you will feel right at home in PHP. In fact, VB COM calls can be converted to PHP COM calls in just a few simple search and replaces.

He shows how to use the COM extension in a (Windows) PHP installation to access the text inside the document and manipulate the contents however you'd like (even writing them back out to another Word file).

tagged: com document word extract content manipulate

Link:

Milw0rm.com:
Exploit - PHP5 COM Object Security Bypass (Windows)
Oct 23, 2007 @ 09:31:00

An exploit for PHP's COM objects on the 5.x series has been reported by shinnai - an issue that allows for a bypass of safe_mode and disable_function settings.

The exploit has been published as a PHP file for easy testing on your Windows/PHP installation (it was tested on WinXP Pro SP2 on both the CLI and Apache). No additional modules are needed for this exploit - only the COM functions and a Windows system.

The issue comes from an overflow in the str_repeat function allowing for the execution of whatever applications the developer wants on the remote Windows machine (including the ability to create and remove files and directories). There is no path for this issue currently (should be corrected in the next minor PHP release).

tagged: com object security bypass safemode disablefunction overflow strrepeat com object security bypass safemode disablefunction overflow strrepeat

Link:

Milw0rm.com:
Exploit - PHP5 COM Object Security Bypass (Windows)
Oct 23, 2007 @ 09:31:00

An exploit for PHP's COM objects on the 5.x series has been reported by shinnai - an issue that allows for a bypass of safe_mode and disable_function settings.

The exploit has been published as a PHP file for easy testing on your Windows/PHP installation (it was tested on WinXP Pro SP2 on both the CLI and Apache). No additional modules are needed for this exploit - only the COM functions and a Windows system.

The issue comes from an overflow in the str_repeat function allowing for the execution of whatever applications the developer wants on the remote Windows machine (including the ability to create and remove files and directories). There is no path for this issue currently (should be corrected in the next minor PHP release).

tagged: com object security bypass safemode disablefunction overflow strrepeat com object security bypass safemode disablefunction overflow strrepeat

Link:

JSLabs Blog:
How to create Microsoft Office Documents with PHP
Jul 02, 2007 @ 12:02:00

From the JSLabs blog today, there's a quick illustration of how to dynamically create three different types of Microsoft Office files - a Word document, Powerpoint and an Excel file.

There are two main ways to build Excel, Word, and PowerPoint documents using PHP. The first is by using the COM library (only if you are using a Windows server) and the other is by using a more standardized approach such as HTML or CSV.

All three examples use the COM method and make basic structures to save out. They also include a screenshot (and description) showing where you can find the list of functions you can call to the COM object for each application.

tagged: microsoftoffice document excel powerpoint word com object microsoftoffice document excel powerpoint word com object

Link:

JSLabs Blog:
How to create Microsoft Office Documents with PHP
Jul 02, 2007 @ 12:02:00

From the JSLabs blog today, there's a quick illustration of how to dynamically create three different types of Microsoft Office files - a Word document, Powerpoint and an Excel file.

There are two main ways to build Excel, Word, and PowerPoint documents using PHP. The first is by using the COM library (only if you are using a Windows server) and the other is by using a more standardized approach such as HTML or CSV.

All three examples use the COM method and make basic structures to save out. They also include a screenshot (and description) showing where you can find the list of functions you can call to the COM object for each application.

tagged: microsoftoffice document excel powerpoint word com object microsoftoffice document excel powerpoint word com object

Link:

Adam Trachtenberg's Blog:
PHP 5 + COM + Skype Help Wanted
Sep 13, 2006 @ 07:15:49

Adam Trachtenberg is looking for some help in the COM department, specficially in using it with PHP5.

I'm trying to use PHP 5.2 to talk to Skype via the COM extension and Skype4COM interface.

I'm using this example from the Skype Forum, but I get a COM exception of "Skype client is not installed."

He also points to someone else with the problem, but still hasn't quite found a solution. Anyone want to help?

tagged: php5 com skype help wanted skype4com interface not installed php5 com skype help wanted skype4com interface not installed

Link:

Adam Trachtenberg's Blog:
PHP 5 + COM + Skype Help Wanted
Sep 13, 2006 @ 07:15:49

Adam Trachtenberg is looking for some help in the COM department, specficially in using it with PHP5.

I'm trying to use PHP 5.2 to talk to Skype via the COM extension and Skype4COM interface.

I'm using this example from the Skype Forum, but I get a COM exception of "Skype client is not installed."

He also points to someone else with the problem, but still hasn't quite found a solution. Anyone want to help?

tagged: php5 com skype help wanted skype4com interface not installed php5 com skype help wanted skype4com interface not installed

Link: