MozPHP

Purpose
License
System Requirements
Limitations
Installation
Compilation
Implementation
Contact
How to help
Credits

PURPOSE

MozPHP is a Mozilla PHP integration package. With MozPHP you can execute PHP scripts in Mozilla directly without the need for a local HTTP server.

Currently the integration is one way, i.e. it is not possible to access Mozilla internals from PHP scripts. This may change in the future but there are no concrete plans for this.


LICENSE

Copyright (c) 2003-2004 Dr. Thomas Schilz

MozPHP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

MozPHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


System Requirements

MozPHP has been developed and tested with Mozilla 1.3.1, 1.4 and 1.5 under Linux and Windows. It won't work with older versions of Mozilla and it has not been tested with other operating systems.

The Mozilla 1.4 binaries have been reported to work with Mozilla Firebird 0.6.1 too. The Mozilla 1.5 binaries should work with Mozilla Firebird 0.7 too.

Of course you also need to have PHP installed on your system. MozPHP works with PHP4 only.


LIMITATIONS

No cookies.
You cannot (yet) set cookies using PHPs setcookie function.
Probably many others I'm not aware of.
If you find one, please inform me. Better yet, fix it.

INSTALLATION

Precompiled binaries are available here for Mozilla 1.4, 1.5 and 1.6 under Linux and Windows. The downloadable zip files are named MozPHP-x_y_os.zip, where x denotes the MozPHP version, y the Mozilla version and os the operating system.

Win32

Download the MozPHP-x_y_win32.zip suitable for your Mozilla and extract it in your Mozilla installation directory. You should now find the following files in the components directory:

Make sure that PHP is installed on your system and that php4ts.dll is in your DLL search path.

Linux

Download MozPHP-x_y_linux.zip suitable for your Mozilla and extract it in your Mozilla installation directory. You should now find the following files in the components directory:

Make sure that PHP is installed on your system and that libphp4.so is in your library search path.

All platforms

Close any open Mozilla windows. Backup and then delete compreg.dat and xpti.dat in the components directory. Restart Mozilla.

MozPHP version 0.1.0 to 0.1.3 only

Open the Preferences dialog. In Navigator / Helper Applications click on the New Type button and add an entry for extension php (and php3 if you like) as follows:

After clicking OK you should find the newly defined type in the File types list like this:

This step is no longer needed in MozPHP version 0.1.4 and higher since MIME type text/php is now assigned to files with extension .php by the cfh protocol handler when opening such files using the cfh: protocol.

Testing it

As a simple test if MozPHP has been installed correctly download test.php and save it in some directory DIR on your local hard disk. Then open cfh://DIR/test.php. As a result you should see something like this:

Now click at the GET Test link, and the result should look as follows:

Finally enter some text, eg. foo into the input field and click at the POST Test button. Now you should get this:


COMPILATION

Win32 only

All platforms


IMPLEMENTATION

MozPHP consists of two components:
PHPToHTMLConv
A stream converter for the conversion of PHP files to HTML. The stream converter integrates a PHP SAPI module.
CFH_Protocol
A protocol handler that partly implements the file protocol and the http protocol.

CONTACT

If you have a problem using or compiling MozPHP, please read the unasked questions. If you can't find a solution for your problem there, try to find out what is going wrong by reading the sources. If you find a solution please send the modifications you made to mozphp@web.de. If you really can't fix the problem yourself, send an email to mozphp@web.de with a detailed description of the problem and of the computing environment you are working with.


HOW TO HELP

Your help is appreciated in the further development of MozPHP.


CREDITS

Thanks to

Philippe Goetz
For sending a patch needed to make MozPHP working with Mozilla 1.5.