# mod_php 5.0 How-To

## ariejan

I just installed PHP5 as an Apache module on my Gentoo system. Since most people would like this, instead of the currently available CLI versions, I have written a how-to. 

You can find this document on my website.

Feel free to post some comments on it. The process is rather straight forward, but I think it will be useful if you don't know where to start. 

Cheers.

Edit: Updated link.Last edited by ariejan on Tue Jun 01, 2004 7:59 pm; edited 2 times in total

----------

## ddanier

thx, that helped  :Smile: 

some comments:

--with-apxs=/usr/sbin/apxs

should be:

--with-apxs2=/usr/sbin/apxs2 (with apache2)

it is possible to install PHP5 the "gentoo-way"...with its own config in conf/modules.d/mod_php5.conf etc.

you could add this  :Smile: 

----------

## Seraphin

ddanier, can you explain with more details how to do with "the gentoo way" since there is no mod_php5 in the portage

I just download the PHP5 beta 3 and I'm blocked while compiling. I've got this error  :Sad:  (

I'm running Apache2.0.48 and I installed PHP4 without any problem (note: I have unmerged mod_php (php4) before trying PHP5)

```
libphp5.la

ext/libxml/libxml.lo: file not recognized: File truncated

collect2: ld returned 1 exit status

make: *** [libphp5.la] Error 1
```

I re emerge libxml, nothing better

I change option to ./configure: 

```
./configure --with-mysql --with-apxs2=usr/sbin/apxs2 --with-libxml-dir=/usr/lib
```

nothing better as well

Just for info, this is my USE variable (in /etc/make.conf)

```
USE="X gtk gnome -alsa kde apache2 bonobo cdr crypt cups curl doc fbcon gb gtk2 gif gpm gtkhtml imap imlib ipv6 java jikes jpeg kerberos ldap libwww mad maildir mbox mcal mmx mozilla mpeg mysql nls oggvorbis pcmcia pda pdflib png pnp python quicktime samba snmp socks5 spell sse ssl svga tiff true type trusted usb videos wmf xml xml2 xmms xv zlib x86 gd2"
```

I also tried to clear my USE variable before ./configure and make, and still nothing...  :Crying or Very sad: 

The only way I found to compile is to not specified --with-apxs2=...

Thanks for your help

----------

## ariejan

Try re-emerging libxml and libxml2.

----------

## iamlarryboy

I have just fiddled 3 hours away trying to get *any* combination of php apache and sqlite to work. I can get php 4&5 to both play real nice with sqlite but apache won't play along. I think a mod_php v. 5 ebuild would help a lot. I tried to modify the v.4 one with no luck. Any out there able to write one? It would be most appreciated.

----------

## ariejan

sqlite is already part of php. Just follow the guide I wrote and you should be fine.

http://www.ariejan.net/content/view/15/2/

If you could post your exact problem, and the log entries related to it, we would be more able to help you.Last edited by ariejan on Tue Jun 01, 2004 8:00 pm; edited 1 time in total

----------

## iamlarryboy

 *ariejan wrote:*   

> sqlite is already part of php. Just follow the guide I wrote and you should be fine.

 

Right. I have php5 with sqlite working fine. it is apache that won't play along. I thought I got everything working right but the code

```

<html>

<body>

<?php

phpinfo();

?>

</body>

</html>

```

returns only

```

<html>

<body>

```

 *ariejan wrote:*   

> If you could post your exact problem, and the log entries related to it, we would be more able to help you.

 

sorry i uninstalled everything and deleted all the logs and config files and started again. I'll see if I can get it to work.

----------

## ariejan

As far as I know, phpinfo doens't need the <html> and <body> tags.

```
<?php

  phpinfo();

?>
```

That should do the trick.[/code]

----------

## To

It should work with the html tags since he opened the PHP after.

Tó

----------

## ariejan

 *To wrote:*   

> It should work with the html tags since he opened the PHP after.
> 
> Tó

 

It does in php4, but are you sure it works in php5 too? Maybe it's his browser. This is the first part of the output I get:

```
<html>

<body>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

<html><head>
```

I imagine not all browsers like that.

----------

## To

even if his browser doesn't render the code, it should be displayed with a view source, since has you know PHP is server side.

Tó

----------

## To

Btw if you want to copile php5 like you copile mod_php from portage there's allways a way.

I ain't going to talk about security or any thing else, just how to use php5.

When you emerge mod_php, the source is unpacked into /var/tmp/portage/mod_php-x/work/php-x. Well just emerge mod_php wait until the config ends, then hit CTR^C and cancel the emerge.

If you are using ~x86 for example you will have this dir /var/tmp/portage/mod_php-4.3.4-r2/work/php-4.3.4 . Chdir to that dir and you will have on config.status the configure command used to emerge mod_php, in my case:

```
./configure  --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-apxs2=/usr/sbin/apxs2 --without-db3 --without-db4 --without-db2 --without-ndbm --with-mcrypt=/usr --with-mhash=/usr --without-interbase --without-ming --without-swf --without-sybase --without-gdbm --without-java --without-mcal --without-unixODBC --without-pgsql --without-snmp --without-pdflib --without-gd --with-png=/usr --with-png-dir=/usr --with-jpeg=/usr --with-jpeg-dir=/usr --enable-exif --without-tiff --with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-freetype-dir=/usr --with-ttf=/usr --with-t1lib=/usr --without-gettext --with-qtdom=/usr/qt/3 --with-pspell=/usr --with-openssl=/usr --with-imap=/usr --without-ldap --with-dom=/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --without-kerberos --with-pam --disable-memory-limit --disable-ipv6 --without-yaz --without-curl --enable-dbx --with-imap-ssl --with-zlib=/usr --with-zlib-dir=/usr --with-sablot=/usr --enable-xslt --with-xslt-sablot --with-xmlrpc --enable-wddx --with-xml --enable-mbstring=all --enable-mbregex --with-bz2=/usr --with-crack=/usr --with-cdb --enable-pcntl --enable-bcmath --enable-calendar --enable-dbase --enable-filepro --enable-ftp --with-mime-magic --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvipc --with-iconv --enable-shmop --enable-dio --enable-yp --without-ncurses --without-readline --enable-inline-optimization --enable-track-vars --enable-trans-sid --enable-versioning --with-config-file-path=/etc/php/apache2-php4
```

You can allways change/add/remove what you want, for example 

```
--with-config-file-path=/etc/php/apache2-php4
```

 to 

```
--with-config-file-path=/etc/php/apache2-php5
```

Tó

----------

## incogne

 *ariejan wrote:*   

> You can find this document on my website.

 

Maybe I'm wrong, but that link doesn't show anything about PHP5. Could you post the right link?

----------

## ariejan

You might be wrong, yes. I currently moving all my previous articles to one 'book'. 

The correct URL is: http://www.ariejan.net/content/view/15/2/Last edited by ariejan on Tue Jun 01, 2004 8:00 pm; edited 1 time in total

----------

## ArieBakVet

Ok ArieJan, from your manual...

The 

```

# ./configure --with-mysql --with-postgresql  --with-apxs2=/usr/sbin/apxs2

```

went fine : 

```

creating sapi/cli/php.1

creating main/php_config.h

creating main/internal_functions.c

creating main/internal_functions_cli.c

+--------------------------------------------------------------------+

| License:                                                           |

| This software is subject to the PHP License, available in this     |

| distribution in the file LICENSE.  By continuing this installation |

| process, you are bound by the terms of this license agreement.     |

| If you do not agree with the terms of this license, you must abort |

| the installation process at this point.                            |

+--------------------------------------------------------------------+

Thank you for using PHP.

mail php-5.0.0RC2 # 

mail php-5.0.0RC2 # 

```

so now for the 

```

mail php-5.0.0RC2 # make

```

Resulting in : 

```

/dom/ -I/root/phpinstall/php-5.0.0RC2/ext/dom/ -DPHP_ATOM_INC -I/root/phpinstall/php-5.0.0RC2/includ

e -I/root/phpinstall/php-5.0.0RC2/main -I/root/phpinstall/php-5.0.0RC2 -I/root/phpinstall/php-5.0.0R

C2/Zend -I/usr/include/libxml2 -I/usr/include/mysql  -I/root/phpinstall/php-5.0.0RC2/TSRM  -g -O2  -

prefer-pic -c /root/phpinstall/php-5.0.0RC2/ext/dom/namednodemap.c -o ext/dom/namednodemap.lo

/bin/sh /root/phpinstall/php-5.0.0RC2/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext

/dom/ -I/root/phpinstall/php-5.0.0RC2/ext/dom/ -DPHP_ATOM_INC -I/root/phpinstall/php-5.0.0RC2/includ

e -I/root/phpinstall/php-5.0.0RC2/main -I/root/phpinstall/php-5.0.0RC2 -I/root/phpinstall/php-5.0.0R

C2/Zend -I/usr/include/libxml2 -I/usr/include/mysql  -I/root/phpinstall/php-5.0.0RC2/TSRM  -g -O2  -

prefer-pic -c /root/phpinstall/php-5.0.0RC2/ext/dom/userdatahandler.c -o ext/dom/userdatahandler.lo

/bin/sh /root/phpinstall/php-5.0.0RC2/libtool --silent --preserve-dup-deps --mode=compile gcc -I"/us

r/include" -Iext/iconv/ -I/root/phpinstall/php-5.0.0RC2/ext/iconv/ -DPHP_ATOM_INC -I/root/phpinstall

/php-5.0.0RC2/include -I/root/phpinstall/php-5.0.0RC2/main -I/root/phpinstall/php-5.0.0RC2 -I/root/p

hpinstall/php-5.0.0RC2/Zend -I/usr/include/libxml2 -I/usr/include/mysql  -I/root/phpinstall/php-5.0.

0RC2/TSRM  -g -O2  -prefer-pic -c /root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c -o ext/iconv/iconv

.lo

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:47:19: iconv.h: No such file or directory

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:134: parse error before "iconv_t"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:135: parse error before "iconv_t"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:249: parse error before "iconv_t"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_appendl':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:251: `s' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:251: (Each undeclared identifier is reported only on

ce

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:251: for each function it appears in.)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:252: `l' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:265: `d' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:270: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: At top level:

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:330: parse error before "iconv_t"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_appendc':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:332: `d' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:332: `c' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:332: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_string':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:345: `iconv_t' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:345: parse error before "cd"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:363: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_strlen':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:509: `iconv_t' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:509: parse error before "cd"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:521: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_substr':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:592: `iconv_t' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:592: parse error before "cd1"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:621: `cd1' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:635: `cd2' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_strpos':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:722: `iconv_t' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:722: parse error before "cd"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:750: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_mime_encode':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:903: `iconv_t' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:903: parse error before "cd"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:943: `cd_pl' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:957: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `_php_iconv_mime_decode':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1236: `iconv_t' undeclared (first use in this functi

on)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1236: parse error before "cd"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1254: `cd_pl' undeclared (first use in this function

)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1364: `cd' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: At top level:

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2296: parse error before "iconv_t"

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2296: warning: no semicolon at end of struct or unio

n

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2304: parse error before '}' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2304: warning: data definition has no type or storag

e class

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2307: parse error before '*' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_dtor':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2309: `self' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: At top level:

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2316: parse error before '*' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_ctor':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2320: `self' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2335: `iconv_t' undeclared (first use in this functi

on)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: At top level:

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2348: parse error before '*' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_append_bucket'

:

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2361: `ps' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2365: `buf_len' undeclared (first use in this functi

on)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2370: `self' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2509: `stream' undeclared (first use in this functio

n)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2510: `buckets_out' undeclared (first use in this fu

nction)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2514: `consumed' undeclared (first use in this funct

ion)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_do_filter':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2532: `self' undeclared (first use in this function)

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2532: parse error before ')' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_cleanup':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2568: parse error before ')' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2569: parse error before ')' token

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c: In function `php_iconv_stream_filter_factory_create

':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2583: `inst' undeclared (first use in this function)

make: *** [ext/iconv/iconv.lo] Error 1

mail php-5.0.0RC2 #

mail php-5.0.0RC2 #

mail php-5.0.0RC2 #

mail php-5.0.0RC2 #

```

then i emerged libiconv

cause i thought that was causing the problem..

so

```

mail php-5.0.0RC2 # emerge -s libiconv

Searching...

[ Results for search key : libiconv ]

[ Applications found : 1 ]

*  dev-libs/libiconv [ Masked ]

      Latest version available: 1.7

      Latest version installed: 1.7

      Size of downloaded files: 2,872 kB

      Homepage:    http://www.gnu.org/software/libiconv/

      Description: This is a fork of the glibc iconv implementation that is incompatible. it may break things.

```

but then again make resulted in :

```

pile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_mm.lo Zend/zend_default_classes.lo Zend/zend_reflection_api.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lcrypt -lmysqlclient -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt  -o sapi/cli/php

ext/iconv/iconv.lo(.text+0x305): In function `_php_iconv_appendl':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:270: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x3f7):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:307: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x4ea): In function `php_iconv_string':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:363: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x539):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:372: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x56b):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:385: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x58f):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:396: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x5fe): In function `_php_iconv_strlen':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:521: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x67f):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:544: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x6aa):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:577: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x718): In function `_php_iconv_substr':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:621: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x7b0):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:644: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x84c):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:701: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x85e):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:705: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x87b):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:652: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x989): In function `_php_iconv_strpos':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:750: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0xa20):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:775: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0xacb):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:893: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0xc58): In function `_php_iconv_mime_encode':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1216: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0xc69):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1219: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0xcae):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:943: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0xcc7):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:957: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0xf9f):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1128: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0xfd2):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1159: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x1173):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1203: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x158e):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1028: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x15c1):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1060: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x15fa):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1076: more undefined references to `libiconv' follow

ext/iconv/iconv.lo(.text+0x1b18): In function `_php_iconv_mime_decode':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1254: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x1c29):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1721: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x1c3a):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1724: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x1dd3):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1365: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x1de8):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:1368: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x36f0): In function `php_iconv_stream_filter_dtor':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2309: undefined reference to `libiconv_close'

ext/iconv/iconv.lo(.text+0x37f9): In function `php_iconv_stream_filter_ctor':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2335: undefined reference to `libiconv_open'

ext/iconv/iconv.lo(.text+0x3972): In function `php_iconv_stream_filter_append_bucket':

/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2377: undefined reference to `libiconv'

ext/iconv/iconv.lo(.text+0x39ff):/root/phpinstall/php-5.0.0RC2/ext/iconv/iconv.c:2443: undefined reference to `libiconv'

collect2: ld returned 1 exit status

make: *** [sapi/cli/php] Error 1

```

Any Ideas ?

----------

## ariejan

You probably need to build some reverse depends. In some cases you need to re-emerge net-libs/libwww

Check my site for some more information: http://www.ariejan.net/content/view/54/2/

----------

## daemonb

Hi,

you wrote that it isn't possible to run php4 module and php5 module in paralell, but can I run php4 as cgi and php5 as module?

What would i have to do?

Thank you

DaemonB

----------

## ariejan

Yes, you can do that. Although I don't recommend it. You'd have to lookup how to setup PHP4 as an Apache CGI. Installing mod_php5 is described in my tutorial.

----------

## drtebi

Well,

I would like to mention that there is now a mod_php5 in the portage tree.

I did this:

```

emerge -v /usr/portage/dev-php/php/php-5.0.1.ebuild

emerge -v /usr/portage/dev-php/mod_php/mod_php-5.0.1.ebuild

```

and it worked out just fine. The only problem I had was that imap did fail when emerge tried to configure. What I did was to unmerge c-client, and then emerge it again without SSL support:

```

emerge unmerge c-client

USE="-ssl" emerge c-client

```

after that, the php5 and mod_php5 emerges worked fine.

'hope that helps some,

DrTebi

----------

## ariejan

True, there is now a mod_php ebuild. However, there when I wrote this tutorial. 

Note that this tutorial still has value if you want to compile PHP (not only on Gentoo) from source.

----------

## binaural

nice, thanks

----------

