View Full Version : Installing Ming

09-09-2008, 10:10 AM
Can anybody give me some good hints for installing php ming. I have spent all afternoon following the install instructions - but failed. I'm stuck! :(

09-09-2008, 01:57 PM
Where are things failing? What errors if any are you getting?

09-09-2008, 03:35 PM
Hello Wildjoker, thanks for taking interest. Where have I gone wrong, could be a number of places...

I compiled the ming library and the php module - okay I think, but there is an instruction at the end of the compile "don't forget to run 'make test'". I ran 'make test' but got an error. Didn't think that was too important so carried on and installed the php module.

At the end of the install I got this information:

/usr/bin/install -c -d `dirname /usr/local`/`php-config --extension-dir`
/usr/bin/install -c -m 755 tmp/modules/ming.so `dirname /usr/local`/`php-config --extension-dir`

ming.so is indeed in tmp/modules - but it is NOT in the php extension folder. Does the install program understand the sybolic link to the php directory? It must do, surely?

I tried running ming anyway, but no joy, so I made a copy of ming.so and put it into the php extension folder myself and tried again - no joy.

The other place I have tried different things is php.ini.

The install instructions advise me to check the "extension_dir" parameter in the php.ini file. Done that. Looks fine.

The last step is to put extension=php_ming.so in php.ini - mmmm isn't it called ming.so?

Tried both. Even tried putting hardcode link to the .so file. No joy.

The install instructions don't tell me to restart the server, but done that anyway. No joy.

Tried a ming php test file - didn't run. Looked at phpinfo() ming is not listed.

Tried everything I can think of... if anyone can point out my mistake I would be very grateful!


09-09-2008, 04:45 PM
I played with this some and pretty much came up with the same things you did. :) One thing I did that you did not is create a symbolic link libming.so.1 since when I ran make test it complained about not finding it.

cd /usr/local/php-5.2.6/dependencies/lib
ln -s /usr/local/lib/libming.so.1 libming.so.1
After I did that I was able to run make test and it got through but complained bout proc_open() being disabled. I kind of stopped at that point since I was starting to get lost in what I was doing. :)

Could be that there needs to be some other symbolic links created. Also did not prefix to other then the default /usr/local when I was messing with this... could be that would make a difference.

I have been trying to look at config.log to see if I can follow things but have not come up with anything yet.

09-09-2008, 06:44 PM
We maybe are nudging closer...

I added your symbolic link and ran make test and got the following error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/php_ming.so'

Well I'm not surprised about that since the installer didn't make a php_ming.so!

The extention that was there was the ming.so file that I copied from the tmp/modules folder. So I renamed it php_ming.so and ran make test again. This gave me the following result:

bogus test name tests/

What does this tell me? Is it working or not?

I copied the run-tests.php from tmp and put it in document root. I saw before that this would give an error if proc_open() was disabled, so I enabled it. I ran run-tests.php and got this error:

#!/usr/bin/php ERROR: environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!

What does that mean?

Anyway, still no ming in phpinfo(). I'll try restarting the server... we must be close now!

09-09-2008, 07:01 PM
No, still no joy...

I have also looked at the install instructions on php.net (http://se2.php.net/manual/en/ming.setup.php) and been thrown into even more confusion.

Tomorrow is another day.

09-10-2008, 05:30 AM
I'll try to get back to this tommarow.

09-10-2008, 06:49 AM
I did figure out one thing. run-tests.php is meant to be used by make test command and not run in the browser.

09-10-2008, 12:16 PM
Yes, I did wonder about run-tests.php

My effort of the day has been to follow the guidelines on lampdocs.com (http://www.lampdocs.com/blog/2008/07/01/how-to-install-ming-support-for-php/). But I had even less success here. I didn't get past the first three instructions when I got this error message:

Command 'make install'
failed with return code 2 and error message
/usr/bin/install: cannot create regular file '/usr/local/lib/pkgconfig/libming.pc':Permission denied
make(3) ***(install-pkgconfigDATA) Error 1
make(2) ***(install-am) Error 2
make(1) ***(install-recursive) Error 1
make: ***(install-recursive) Error 1

I had a look at pkgconfig and noted that it is chmoded to 555. Only root can change this.

Looks like ming is not going to install.

09-11-2008, 10:58 AM
Ok I got it to work. Some of this may be overkill but thought I would give you everything I did. :)

It can be installed into another location by using --prefix=/some/other/path. Before you do this you need to open up /etc/ld.so.conf file and add /some/other/path to the file. After you run make and make install you would then run ldconfig. The entire process would look something like this.

Open /etc/ld.so.conf and add:


cd /ming-0.4.0.rc1
make uninstall
make clean
cd php_ext
make uninstall
make clean
cd /ming-0.4.0.rc1
./configure --prefix=$HOME --enable-php
make install

Double check your php.ini to see if that extension=ming.so is there. Should be there from when you ran things before.

Once that was done I ran this code: (not real sure if this was needed or not. You might want to check phpinfo() first.)

cd php_ext/tmp

After running all of the above I checked phpinfo() and ming showed up.

Note the examples on php.info did not work for me. I kept getting errors. I ended up going to http://www.gazbming.com/ using some of those examples. The error that was getting thrown was because of how the php.net examples used SWFAction. The below modified example from php.net does work:

$s = new SWFShape();
$f = $s->addFill(0xff, 0, 0);

$s->movePenTo(-500, -500);
$s->drawLineTo(500, -500);
$s->drawLineTo(500, 500);
$s->drawLineTo(-500, 500);
$s->drawLineTo(-500, -500);

$p = new SWFSprite();
$i = $p->add($s);

for ($n=0; $n<5; ++$n) {

$m = new SWFMovie();
$m->setBackground(0xff, 0xff, 0xff);
$m->setDimension(6000, 4000);

$i = $m->add($p);
$m->add(new SWFAction("_root['box']._x += 30;"));
//$m->add(new SWFAction("/box.x += 3;"));
$m->add(new SWFAction("gotoFrame(0); play();"));

header('Content-type: application/x-shockwave-flash');
You can see where I commented out what they had and used _root['box']._x += 30; instead. I can't remember what led me to try that but I saw it in one of the sites I was searching for answers in.

09-11-2008, 11:03 AM

yourusername in the above is replaced with your actual username. $HOME is an internal reference to that path. Both of these could be changed to your liking. The important thing is that you can not install into /usr/local which is the default. This is a pretty old page but Matt shows how sometimes this has to be done on installation of things. http://www.domsch.com/westhost/

09-14-2008, 09:18 AM
Thanks for your great efforts! I am pleased to hear that you have got ming working on your setup. I followed your instructions but didn't quite make it... I tried several times and also on another (newly setup) server. But got stuck at the same place. This is the error message I get when trying to execute ldconfig.

ldconfig: Can't link /usr/lib/libstdc++-libc6.1-1.so.2 to libstdc++-2-libc6.1-1-2.9.0.so

Other points:

1. Thanks for the p.s. about $HOME. I did wonder about that.
2. I did try to install in usr/local but when that didn't work I tried to install from root since I understand this is more likely to succeed if there are problems.
3. The domsch.com (http://www.domsch.com/westhost/) link was very useful.

09-14-2008, 11:03 AM
The error you got should not affect the installation of Ming. I had the same error and in fact I think it normally happens on install of things if I recall correct. Not sure why that is since I have never really investigated it. Sorry I did not mention I had the same error.

09-16-2008, 03:45 AM
Thank you once again for your great efforts! Trying to install Ming has taken some time hasn't it! Surely it should be easier than this?

I have now installed ming on 3 servers, but it refuses to install on a fourth. Well, we have to draw the line somewhere and this seems to be a good point.

Thanks for your help :)

Now I will try and install OpenLaszlo (http://www.openlaszlo.org/) - wish me luck!

09-16-2008, 05:19 AM
Now I have got ming to install on the other server.

In Wildjoker's solution he gives instructions to make and make install in the ming-0.4.0.rc1 folder - and that seems to work most of the time.

In the original install instructions for ming-0.4.0.rc1 you are told to also go into the php_ext and make and make install.

I did this as well on the troublesome server - and now I get ming in phpinfo() :D

Odd isn't it?

09-17-2008, 05:11 AM
For anybody who has been following this Ming installation and wants to try it out for themselves you may find the following links for fdb fonts useful:

The Bitstream Vera font can be downloaded from:
SourceForge.net (http://sourceforge.net/project/showfiles.php?group_id=18365&package_id=13925&release_id=213160)

I looked around the net for other fdb fonts and eventually came across this handy small selection posted on:
robertinventor.com (http://robertinventor.com/software/winming/fonts_fdb.zip)

The one I really want is DejaVu sans but haven't found that yet.

The RC1 release of Ming claims to support ttf files, but I haven't managed to get that working yet.
Ming is going to keep me busy for a while..!

09-18-2008, 02:46 AM
My mistake - ttf fonts are working, so is UTF8. Now I am a happy man. :D
My thanks to Shawn for the invaluable help.