Basic PHP/Ming 0.3a setup for Windows

Update 2006

Fastest way to win32 ming is grab xampp or the windows binaries zip at PHP.NET as both of these have ming 0.3beta inside so the method detailed below is useful only if these do not work for you.


If you cannot get to your linux box you could try this method which is just a simple working setup for testing and experimenting purposes...

Ming homepage at sourceforge : http://ming.sourceforge.net/

1) Make dir c:\ming

2) Download these files from the PHP4 page at http://kromann.info/php.php into c:\ming:
php.exe , php4ts.dll , php_ming.dll

3) Download php-4.3.2-Win32.zip from http://www.php.net/downloads.php (see note below)

4) copy php.ini-dist from zip file to c:\ming & rename it php.ini

5) edit php.ini & change

;extension=php_ming.dll
to
extension=php_ming.dll

6) copy code below and save as c:\ming\square.php

7) to compile this php at the command line open a dos shell and type
#> cd c:\ming
#> php square.php
square.swf will be saved to c:\ming assuming all went well.

######## square.php ########
// a red square...
// code by gazb : gazb dot ming at NOSPAM gmail dot com
// http://www16.brinkster.com/gazb/ming/
< ?
Ming_setScale(20.00000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(0xcc,0xcc,0xcc);
$movie->setRate(12);
$squareshape=new SWFShape();
$squareshape->setRightFill(255,0,0);
$squareshape->drawLine(100,0);
$squareshape->drawLine(0,100);
$squareshape->drawLine(-100,0);
$squareshape->drawLine(0,-100);
$squaresymbol=$movie->add($squareshape);
$squaresymbol->moveTo(100,100);
$movie->save("square.swf");
?>
######## square.php ########


8) That is it, it worked for me, it may work for you... or it may not...

######## END ########

lots of ming 0.3a examples here http://www16.brinkster.com/gazb/ming/


Note: if you cannot download php-4.3.2-Win32.zip to get a php.ini you could try this: copy and paste the following into a text file and save as php.ini

--------------------------
extension_dir=C:/ming
extension=php_ming.dll
--------------------------

and another thing...
if you need an editor you could grab Scite/Scintilla at http://scintilla.sourceforge.net/SciTEDownload.html...
if you grab this one : "A single file executable called Sc1 (270K)" for example and put it in c:\ming then use it to edit your .php pages. Then just press F5 to compile your php and build your swf...
or you could use the SciTE|Flash version at http://www.bomberstudios.com/sciteflash/ which is customised for ActionScript...

and finally... you might want to also grab the "php graphics extension" php_gd2.dll from http://kromann.info/php4.php then enable it in php.ini. aside from being useful and cool there are two examples which use this extension (linedrawing & pixels)...

hope that helps

thanks to Frank Kromann for compiling & hosting the php exe/dll files...


Actionscript only movies

You can compile MX Actionscript using Ming 0.3 in several ways. 
Try this template below for example. 
Just change the "someActionscript.as" to the name of an .as file you want to compile....
< ?#
// code by gazb : gazb dot ming at NOSPAM gmail dot com
// http://www16.brinkster.com/gazb/ming/
// some typical movie variables
Ming_setScale(20.00000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,600);
$movie->setBackground(0xCC,0xCC,0xCC);
$movie->setRate(31); 
// get as from external file(s)
$strAction = join("", file("someActionscript.as"));
// add actionscript to movie
$movie->add(new SWFAction($strAction));
// save movie
$movie->save("someMovie.swf");
?>

-----------------------------------------------------


PHP5

The above is for PHP4 but you could grab the files from the PHP5 page instead and do some small amends to the above and it should work (ie grab php5ts.dll (rather than php4ts.dll) and msvcr71.dll from kromann.info & a PHP5 version of php.ini-dist from php.net)

-----------------------------------------------------




end