# Compiling a new library

- Thread: https://externals.io/message/15790
- Original archive: https://news-web.php.net/php.internals/15790
- Started by Michel JORDA on 2005-04-04T12:47:26+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15790 — Michel JORDA — 2005-04-04T12:47:26+00:00

URL: https://externals.io/message/15790#15790

Hi everybody
I Have to compile a library (namely, a payment library) and the bank
release a .c source. Therefore I need to make and compile it, but they
mention that
"you need to install the php-devel package in order to compile"...
what should I download 
- on my macosx 
- and on my linux 
to compile that ?
Thanks for your help
MJ

---

## #15792 — Andrey Hristov — 2005-04-04T13:55:20+00:00

URL: https://externals.io/message/15790#15792 · In reply to: #15790

Michel JORDA wrote:
> Hi everybody
> I Have to compile a library (namely, a payment library) and the bank
> release a .c source. Therefore I need to make and compile it, but they
> mention that
> "you need to install the php-devel package in order to compile"...
> what should I download 
> - on my macosx 
> - and on my linux 
> to compile that ?
> Thanks for your help
> MJ
> 
  Hi,
you may get PHP sources from www.php.net . Then untar in some directory.
Then you need to create the skeleton of your extension by either executing
ext/ext_skel.sh or using PEAR's module for doing that.
Then you need to edit your config.m4 which will be under ext/xyz/config.m4
(xyz is the name of the extension). Then re-run ./buidlconf . After that
just use configure (configure --help | less should show your extension).
For compiling - make. Every time you change sth in config.m4 you have to re-run
buildconf. There is a way to build only a specific directory with phpize but
then you need to have this php-devel package or to have installed from source
with make install.

HTH,
Andrey

---

## #15836 — Michel JORDA — 2005-04-06T00:41:16+00:00

URL: https://externals.io/message/15790#15836 · In reply to: #15792

Thanks for your help everybody ! it seems that the "better" way i found
is

cd <mydirectory> 
phpize 
autoconf 
./configure 
make 
make install

assuming that php is installed in the machine. I dont think the src are
needed. 
Thanks for your help

Michel

Andrey Hristov <php@hristov.com> wrote:

> Michel JORDA wrote: > Hi everybody > I Have to compile a library (namely,
> a payment library) and the bank > release a .c source. Therefore I need to
> make and compile it, but they > mention that > "you need to install the
> php-devel package in order to compile"... > what should I download > - on
> my macosx > - and on my linux > to compile that ? > Thanks for your help >
> MJ > Hi, you may get PHP sources from www.php.net . Then untar in some
> directory. Then you need to create the skeleton of your extension by
> either executing ext/ext_skel.sh or using PEAR's module for doing that.
> Then you need to edit your config.m4 which will be under ext/xyz/config.m4
> (xyz is the name of the extension). Then re-run ./buidlconf . After that
> just use configure (configure --help | less should show your extension).
> For compiling - make. Every time you change sth in config.m4 you have to
> re-run buildconf. There is a way to build only a specific directory with
> phpize but then you need to have this php-devel package or to have
> installed from source with make install.
> 
> HTH, Andrey

---

## #15842 — Andrey Hristov — 2005-04-06T06:10:56+00:00

URL: https://externals.io/message/15790#15842 · In reply to: #15836

You definitely need header files

Andrey

Michel JORDA wrote:
> Thanks for your help everybody ! it seems that the "better" way i found
> is
> 
> cd <mydirectory> 
> phpize 
> autoconf 
> ./configure 
> make 
> make install
> 
> assuming that php is installed in the machine. I dont think the src are
> needed. 
> Thanks for your help
> 
> Michel
> 
> Andrey Hristov <php@hristov.com> wrote:
> 
> 
> > […]
