To compile your own extension:
- Assuming you have the Newt development package installed,
run:
# /usr/local/zend/bin/pecl
install newt
The truncated output of this command, along with explanations:
PECL retrieves the package from the
repository...*/ downloading newt-1.2.1.tgz
Starting to download newt-1.2.1.tgz (24,853 bytes)
.........done: 24,853 bytes
5 source files, building
/*The phpize script is executed...*/
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/newt-1.2.1
Configure comes into play
running: /tmp/pear/download/newt-1.2.1/configure
checking for grep that handles long lines and -e...
/bin/grep checking for egrep... /bin/grep -E checking for a sed
that does not truncate output... /bin/sed checking for gcc...
gcc checking for C compiler default output file name... a.out
checking whether the C compiler works... yes checking whether
we are cross compiling... no checking for suffix of executables...
checking for suffix of object files... o
Next comes libtool.
creating libtool
appending configuration tag "CXX" to
libtool
configure: creating ./config.status
config.status: creating config.h
The actual compilation process: calls
make which internally triggers GCC and LD.
running: make
/bin/sh /var/tmp/pear-build-root/newt-1.2.1/libtool
--mode=compile gcc -I. -I/tmp/pear/download/newt-1.2.1 -DPHP_ATOM_INC
-I/var/tmp/pear-build-root/newt-1.2.1/include
-I/var/tmp/pear-build-root/newt-1.2.1/main
-I/tmp/pear/download/newt-1.2.1 -I/usr/local/zend/include/php
-I/usr/local/zend/include/php/main -I/usr/local/zend/include/php/TSRM
-I/usr/local/zend/include/php/Zend -I/usr/local/zend/include/php/ext
-I/usr/local/zend/include/php/ext/date/lib
-I/usr/local/zend/include/php -DHAVE_CONFIG_H -g
-O2 -c
/tmp/pear/download/newt-1.2.1/newt.c -o newt.lo
mkdir .libs gcc -I. -I/tmp/pear/download/newt-1.2.1 -DPHP_ATOM_INC
-I/var/tmp/pear-build-root/newt-1.2.1/include
-I/var/tmp/pear-build-root/newt-1.2.1/main
-I/tmp/pear/download/newt-1.2.1 -I/usr/local/zend/include/php
-I/usr/local/zend/include/php/main -I/usr/local/zend/include/php/TSRM
-I/usr/local/zend/include/php/Zend -I/usr/local/zend/include/php/ext
-I/usr/local/zend/include/php/ext/date/lib -I/usr/local/zend/include/php
-DHAVE_CONFIG_H -g -O2 -c /tmp/pear/download/newt-1.2.1/newt.c
-fPIC -DPIC -o .libs/newt.o /bin/sh /var/tmp/pear-build-root/newt-1.2.1/libtool
--mode=compile gcc -I. -I/tmp/pear/download/newt-1.2.1 -DPHP_ATOM_INC
-I/var/tmp/pear-build-root/newt-1.2.1/include
-I/var/tmp/pear-build-root/newt-1.2.1/main
-I/tmp/pear/download/newt-1.2.1 -I/usr/local/zend/include/php
-I/usr/local/zend/include/php/main -I/usr/local/zend/include/php/TSRM
-I/usr/local/zend/include/php/Zend -I/usr/local/zend/include/php/ext
-I/usr/local/zend/include/php/ext/date/lib
-I/usr/local/zend/include/php -DHAVE_CONFIG_H -g
-O2 -c
/tmp/pear/download/newt-1.2.1/newt_vcall.c -o newt_vcall.lo
gcc -I. -I/tmp/pear/download/newt-1.2.1 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/newt-1.2.1/include
-I/var/tmp/pear-build-root/newt-1.2.1/main
-I/tmp/pear/download/newt-1.2.1 -I/usr/local/zend/include/php
-I/usr/local/zend/include/php/main -I/usr/local/zend/include/php/TSRM
-I/usr/local/zend/include/php/Zend -I/usr/local/zend/include/php/ext
-I/usr/local/zend/include/php/ext/date/lib -I/usr/local/zend/include/php
-DHAVE_CONFIG_H -g -O2 -c /tmp/pear/download/newt-1.2.1/newt_vcall.c
-fPIC -DPIC -o .libs/newt_vcall.o
/bin/sh /var/tmp/pear-build-root/newt-1.2.1/libtool
--mode=link gcc -DPHP_ATOM_INC -I/var/tmp/pear-build-root/newt-1.2.1/include
-I/var/tmp/pear-build-root/newt-1.2.1/main
-I/tmp/pear/download/newt-1.2.1 -I/usr/local/zend/include/php
-I/usr/local/zend/include/php/main -I/usr/local/zend/include/php/TSRM
-I/usr/local/zend/include/php/Zend -I/usr/local/zend/include/php/ext
-I/usr/local/zend/include/php/ext/date/lib
-I/usr/local/zend/include/php -DHAVE_CONFIG_H -g
-O2 -o newt.la
-export-dynamic -avoid-version -prefer-pic -module
-rpath /var/tmp/pear-build-root/newt-1.2.1/modules newt.lo
newt_vcall.lo -lnewt gcc -shared .libs/newt.o .libs/newt_vcall.o
-lnewt -Wl,-soname -Wl,newt.so -o .libs/newt.so creating
newt.la (cd .libs && rm -f newt.la && ln -s ../newt.la
newt.la) /bin/sh /var/tmp/pear-build-root/newt-1.2.1/libtool --mode=install
cp ./newt.la /var/tmp/pear-build-root/newt-1.2.1/modules
cp ./.libs/newt.so /var/tmp/pear-build-root/newt-1.2.1/modules/newt.so
cp ./.libs/newt.lai /var/tmp/pear-build-root/newt-1.2.1/modules/newt.la
PATH="$PATH:/sbin" ldconfig -n /var/tmp/pear-build-root/newt-1.2.1/modules
----------------------------------------------------------------------
Libraries have been installed in:
/var/tmp/pear-build-root/newt-1.2.1/modules
Build complete.
- Run 'make test'.
- Use PECL to put the newly built Newt extension into place.
run: make INSTALL_ROOT="/var/tmp/pear-build-root/install-newt-1.2.1"
- instal the shared extensions by running:
var/tmp/pear-build-root/install-newt-1.2.1//usr/local/zend/lib/php_extensions/
running: find "/var/tmp/pear-build-root/install-newt-1.2.1"
| xargs ls -dils
574096 4 drwxr-xr-x 3 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1
574119 4 drwxr-xr-x 3 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1/usr
574120 4 drwxr-xr-x 3 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1/usr/local
574121 4 drwxr-xr-x 3 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1/usr/local/zend
574122 4 drwxr-xr-x 3 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1/usr/local/zend/lib
574123 4 drwxr-xr-x 2 root root 4096
Mar 30 20:45
/var/tmp/pear-build-root/install-newt-1.2.1/usr/local/zend/lib/php_extensions
574118 244 -rwxr-xr-x 1 root root 241717 Mar 30
20:45 /var/tmp/pear-build-root/install-newt-1.2.1/usr/local/zend/lib/php_extensions/newt.so
Build process completed successfully
Installing '/usr/local/zend/lib/php_extensions/newt.so'
install ok: channel://pear.php.net/newt-1.2.1
- The Extension has been successfully compiled using PECL.
- To load the extension, in the php.ini or in a separate
file under the scan dir insert extension=<my_extension_name>.so
and replace <my_extension_name> with your extension's
binary name such as "extension=newt.so".
- If you're using the DEB and RPM versions of Zend Server, the best
practice is to place a file called newt.ini under /usr/local/zend/etc/conf.d.
- Restart your webserver.
|