---
title: "Compilera php extension from source"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/49101-compilera-php-extension-from-source"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "niels"
published: "2002-07-31T04:59:49.000Z"
updated: "2002-07-31T07:09:56.000Z"
replies: 2
views: 181
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/49101-compilera-php-extension-from-source"
---

# Compilera php extension from source

## #1 — niels, 2002-07-31T04:59Z

Jag forsoker att installera php_templates men far inte riktig det hela att fungera.

Testade forst att installera den fardig komilerade php_templates.so linux versionen, men nar jag startade om apache fick jag segmentation fault. 

Sen forsokte jag med att kompilera en egen version och foljde install doc :

```
internal extension:

	cd <PHP_dir>/ext
	tar -zxf /path/to/templates.tar.gz
	cd ..
	./buildconf
	./configure <your_parameters> --enable-templates
	make
	make install

external extension: /* you should have PHP installed */

	tar -zxf templates.tar.gz
	cd temlpates
	phpize
	./configure --enable-templates=shared
	make

/* get the "modules/templates.so" module and be happy */
```

anvande external extension versionen men det funka inte...

Bilagor:

- [php_templates-1.1.tar.gz](https://www.webforum.nu/a/354.gz)

Permalänk: https://www.webforum.nu/p/49101

## #2 — SPiN, 2002-07-31T05:05Z

Vill du itne behöva kompilera om PHP, så kan du ju alltid ladda in din extensions manuellt i dina dokument:

```
<?php
if( !extension_loaded( "templates" ) ) {
     $bool = dl( "templates.so" );

     if( !$bool )
          die( "Couldn't load extension 'templates.so'" );
}
...
```

Permalänk: https://www.webforum.nu/p/736765

## #3 — niels, 2002-07-31T07:09Z

Problemet ar ju att jag inte vet hur jag skall kompilera source-filerna till \*.so

Permalänk: https://www.webforum.nu/p/736790

---

Tråden på webben: https://www.webforum.nu/amne/php/49101-compilera-php-extension-from-source
