PHPBuilder - Getting Started with PHP/Ming Page 2

RSS Twitter

Getting Started with PHP/Ming - Page 2

by: Iman S. H. Suyoto
August 10, 2001

Installing PHP/Ming on Debian GNU/Linux

Okay, I'll use $MINGINST to state Ming installation directory. For example, in my computer, the installation directory is /usr/apps/src/ming-0.1.1. So, if I say $MINGINST/php_ext, it means /usr/apps/src/ming-0.1.1/php_ext.
My initial (intuitive, again) step was trying to recompile the source code to get the shared object. The README stated that the first thing to do was simply typing make static. This produced $MINGINST/libming.a and some object files under $MINGINST/src. Next, still following the README, I changed directory to $MINGINST/php_ext and typed make. Whew... lots of errors. I read the error messages and they were about header files being not found. Maybe you think that it shouldn't be a problem if we have apt-got (err... perfect form of apt-get...) install php4-dev (for your information, I'm using the stable version). The fact is: it is, and it is because of the Debian directory layout that "confuses" php-config --includes being used inside Makefile. The same thing also applies for php-config --extension-dir.

With such a condition, in such a "quick and dirty" way, I modified Makefile so it became like this: (includes wrapped for formatting for this example)

prefix=`php-config --prefix`

includes=-I /usr/include/php4/main -I /usr/include/php4/Zend \
-I /usr/include/php4/ext/standard -I /usr/include/php4 \
-I /usr/include/php4/TSRM


CFILES = ming.c ming.o
	${CC} -shared -fpic ming.o ../libming.a -o -lm

ming.o: ${CFILES}
	${CC} ${DEFINES} -c ming.c -I. -I.. ${includes} 

	rm -f

	cp ${extension} 
	echo "Don't forget to add '' to php.ini!"

Please notice the changes: two additional variables (includes and extension) and a few changes in the targets ming.o and install.

« Previous Page
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Iman S. H. Suyoto



(Maximum characters: 1200). You have characters left.