# [SOLVED]Squirrelmail troubles

## AMSch

Hello!

I have emerged squirrelmail in order to have a web-frontend for my fetchmail / courier-imap setup. I have emerged squirrelmail version 1.4.5-r1 with PHP Version 4.4.1-pl3-gentoo

.

If I try to access squirrelmail via browser I get:

```

Fatal error: Call to undefined function: session_id() in /var/www/localhost/htdocs/squirrelmail/functions/global.php on line 332

```

But if I run a test.php file it works - can anybody help please? I have already read, that squirrelmail doesnt work with php5.Last edited by AMSch on Tue May 02, 2006 8:00 am; edited 1 time in total

----------

## Falador

It looks like either session support wasn't compiled into php or it's switched off. I'd guess it's disabled.

Create your test.php file containing the line:

```
<? phpinfo(); ?>
```

View it in your browser, under the section 'Session' you should see a line reading

"Session Support enabled"

----------

## AMSch

"Configure command" : '--disable-session'

How can I enable this?

Thanks very much!

----------

## AMSch

I have now re-emerged php with session support, but if I try to access start page the page remains blank and no error is displayed  :Sad: 

Configure Command:

```

'./configure' '--prefix=/usr/lib/php4' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php4' '--with-config-file-scan-dir=/etc/php/apache2-php4/ext-active' '--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar' '--disable-ctype' '--with-curl' '--disable-dbase' '--without-dom' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filepro' '--disable-ftp' '--with-gettext' '--without-gmp' '--without-hwapi' '--without-iconv' '--without-informix' '--without-kerberos' '--enable-mbstring' '--without-mcal' '--with-mcrypt' '--without-mcve' '--disable-memory-limit' '--without-mhash' '--without-ming' '--without-mnogosearch' '--without-msql' '--without-mssql' '--with-ncurses' '--without-oci8' '--without-oci8-instant-client' '--without-oracle' '--with-openssl' '--with-openssl-dir=/usr' '--disable-overload' '--without-ovrimos' '--disable-pcntl' '--without-pcre-regex' '--without-pfpro' '--without-pgsql' '--disable-posix' '--with-pspell' '--with-recode' '--disable-shmop' '--without-snmp' '--disable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--disable-tokenizer' '--disable-wddx' '--without-xmlrpc' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--with-gdbm' '--without-inifile' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-tiff-dir' '--without-xpm-dir' '--with-gd' '--without-mysql' '--with-readline' '--without-libedit' '--disable-xslt' '--without-xslt-sablot' '--without-mm'

```

But apache2 error_log tells me [notice] child pid 21959 exit signal Illegal instruction (4)

Can you help please?

----------

## Falador

What USE flags did you use to install php?

----------

## AMSch

I cant remember - is there a way to find out?

----------

## martap

If you have the gentoolkit package installed, you can use:

```
equery u dev-lang/php
```

----------

## AMSch

Thanks for the tip!

```

morpheus ~ # equery u dev-lang/php

[ Searching for packages matching dev-lang/php... ]

[ Colour Code : set unset ]

[ Legend        : Left column  (U) - USE flags from make.conf                     ]

[                  : Right column (I) - USE flags packages was installed with ]

[ Found these USE variables for dev-lang/php-4.4.1-r3 ]

 U I

 - - adabas              : Adds support for the Adabas database engine

 - - apache              : Chooses Apache1 support when a package optionally supports Apache1

 + + apache2             : Chooses Apache2 support when a package supports both Apache1 and Apache2

 - - bcmath              : Adds support for libbcmath

 + + berkdb              : Adds support for sys-libs/db (Berkeley DB for MySQL)

 - - birdstep            : Adds support for the Birdstep Database Server

 + + bzip2               : Use the bzlib compression library

 - - calendar            : Adds support for calendars (not using mcal!)

 - - cdb                 : Adds support for the CDB database engine from the author of qmail

 - - cgi                 : Enable CGI SAPI

 - - cjk                 : Adds support for Multi-byte character languages (Chinese, Japanese, Korean)

 - - cli                 : Enable CLI SAPI

 + + crypt               : Add support for encryption -- using mcrypt or gpg where applicable

 - - ctype               : Enables ctype functions

 + + curl                : Adds support for client-side URL transfer library

 - - db2                 : Enables support for IBM DB2 database server

 - + dba                 : Enables dbm-compatible layers

 - - dbase               : Adds support for dbase file format

 - - dbmaker             : Adds support for dbmaker database server

 - - dbx                 : Adds database abstraction layer

 - - debug               : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too

 - - discard-path        : Switch on common security setting for CGI SAPI

 - - doc                 : Adds extra documentation (API, Javadoc, etc)

 - - empress             : Adds support for the Empress database server

 - - empress-bcs         : Adds local access support for the Empress database server

 - - esoob               : Adds support for Easysoft OOD database

 - - exif                : Adds support for reading EXIF headers from JPEG and TIFF images

 + + expat               : Enable the use of dev-libs/expat

 - - fastbuild           : Build PHP quicker (experimental)

 - - fdftk               : Add supports for Adobe's FDF toolkit.

 - - filepro             : Adds support for filePro databases

 - - firebird            : Adds support for the Firebird relational database

 - - flatfile            : Adds dbm support for flat files

 - - force-cgi-redirect  : Switch on common security setting for CGI SAPI

 - - frontbase           : Adds support for the frontbase sql server

 - - ftp                 : Adds FTP support

 + + gd                  : Adds support for media-libs/gd (to generate graphics on the fly)

 - - gd-external         : Use the external version of gd rather than the bundled one (possibly dangerous)

 + + gdbm                : Adds support for sys-libs/gdbm (GNU database libraries)

 - - gmp                 : Adds support for dev-libs/gmp (GNU MP library)

 - - hardenedphp         : include the hardened php security patch for the php group of ebuilds

 - - hyperwave-api       : Adds support for Hyperwave document storage system

 - - iconv               : Enable support for the iconv character set conversion library

 - - imap                : Adds support for IMAP

 - - informix            : Adds support for Informix database

 - - inifile             : Adds dbm support for .ini files

 - - interbase           : Adds support for Interbase database

 - - iodbc               : Adds support for iODBC library

 + + ipv6                : Adds support for IP version 6

 - - java-external       : Use the external java extension rather than the bundled one

 - - java-internal       : Use the bundled java extension in PHP4

 - - kerberos            : Adds kerberos support

 - - ldap                : Adds LDAP support (Lightweight Directory Access Protocol)

 - - libedit             : Use the libedit library (replacement for readline)

 - - mcal                : Adds support for MCAL calendar system

 - - mcve                : Support for the MCVE credit card payment system

 - - memlimit            : Adds memory usage limiting in supporting programs

 - - mhash               : Adds support for the mhash library

 - - ming                : Adds support for ming library for creating flash format files

 - - mnogosearch         : Adds support for the mnoGoSearch search engine

 - - msql                : Adds support for the MSQL database server

 - - mssql               : Adds support for Microsoft SQL Server database

 - - mysql               : Adds mySQL support

 + + ncurses             : Adds ncurses support (console display library)

 + + nls                 : Adds Native Language Support (using gettext - GNU locale utilities)

 - - oci8                : Adds Oracle 8 Support

 - - oci8-instant-client : Use dev-db/oracle-instantclient-basic as Oracle provider instead of requiring a full Oracle server install

 - - odbc                : Adds ODBC Support (Open DataBase Connectivity)

 - - oracle7             : Adds support for Oracle 7

 - - overload            : Enable the overload extension

 - - ovrimos             : Adds support for the Ovrimos Database engine

 - - pcntl               : Adds support for process creation functions

 - - pcre                : Adds support for Perl Compatible Regular Expressions

 - - pfpro               : Adds support for Verisign Payflow Pro

 - - pic                 : Build Position Independent Code.  Do not utilize this flag unless you know what you're doing.

 - - posix               : Adds support for POSIX-compatible functions

 - - postgres            : Adds support for the postgresql database

 + + readline            : enables support for libreadline, a GNU line-editing library that most everyone wants.

 + + recode              : enables support for the GNU recode library

 - - sapdb               : Adds support for SAP DB

 - + session             : Adds persistent session support

 - - sharedext           : Adds support for building shared extensions in php

 - - sharedmem           : Adds support for shared memory use

 - - snmp                : Adds support for the Simple Network Management Protocol if available

 - - sockets             : Adds support for tcp/ip sockets

 - - solid               : Adds support for the Solid database engine

 + + spell               : Adds dictionary support

 - - sqlite              : Adds support for sqlite - embedded sql database

 + + ssl                 : Adds support for Secure Socket Layer connections

 - - sybase              : Adds support for the Sybase SQL Database Server

 - - sybase-ct           : Adds support for Sybase-CT

 - - sysvipc             : Support for System V-compatible inter-process communication

 - - threads             : Adds threads support for various packages. Usually pthreads

 - - tiff                : Adds support for the tiff image format

 - - tokenizer           : Adds support for the PHP file parser

 + + truetype            : Adds support for FreeType and/or FreeType2 fonts

 - - wddx                : Adds support for WDDX

 - - xml                 : Check/Support flag for XML library (version 1)

 - - xmlrpc              : Support for xml-rpc library

 - - xpm                 : Support for XPM graphics format.

 - - xsl                 : Check/Support flag for XSL library (version 1)

 - - yaz                 : Adds in optional support for the Z39.50 Protocol for Information Retrieval (YAZ)

 - - zip                 : Enable ZIP file support

 + + zlib                : Adds support for zlib (de)compression

```

----------

## Falador

What about dev-php/mod_php?

EDIT: Reading your post again I noticed you have dev-lang/php. Try unmerging dev-lang/php and emerging dev-php/php and dev-php/mod_php.

----------

## AMSch

Unmerged dev-lang/php and merged dev-php/php and dev-php/mod_php -> didnt work  :Sad:  Same errror as before.

----------

## Falador

Have you reinstalled apache since? Do you have the USE flag "threads" enabled for apache, if you do disable it.

----------

## smity

I have the same problème.

USE flag "session" in php !

emerge -pv dev-lang/php

/etc/init.d/apache2 restart

and... run !!!!!

----------

## smity

and after there is an another bug like when you log in :

"Fatal error: Only variables can be passed by reference in /usr/share/webapps/squirrelmail/1.4.5/htdocs/functions/imap_messages.php on line 480"

You can fix it, by a fix, not yeat in portage tree.

So be patient !

----------

## smity

It is a Know bug from squirrelmail : 

http://www.squirrelmail.org/wiki/BrowseProblemsByPhpError

Juste replacing in file : /usr/share/webapps/squirrelmail/1.4.5/htdocs/functions/imap_messages.php on ligne 380

/*

function parsePriority($value) {                                                                                                                                                                                   

  $value = strtolower(array_shift(split('/\w/',trim($value))));                                                                                                                                                    

  if ( is_numeric($value) ) {                                                                                                                                                                                      

    return $value;                                                                                                                                                                                                 

  }                                                                                                                                                                                                                

  if ( $value == 'urgent' || $value == 'high' ) {                                                                                                                                                                  

    return 1;                                                                                                                                                                                                      

  } elseif ( $value == 'non-urgent' || $value == 'low' ) {                                                                                                                                                         

    return 5;                                                                                                                                                                                                      

  }                                                                                                                                                                                                                

  return 3;                                                                                                                                                                                                        

}                                                                                                                                                                                                                  

*/

------------------------------

REPLACING BY !

------------------------------

function parsePriority($sValue)

{

  $aValue=split('/\w/',trim($sValue));

  $value = strtolower(array_shift($aValue));

  if ( is_numeric($value) ) {

    return $value;

  }

  if ( $value == 'urgent' || $value == 'high' ) {

    return 1;

  }

  elseif ( $value == 'non-urgent' || $value == 'low' ) {

    return 5;

  }

  return 3;

}

that all !

Good Luck.

----------

## AMSch

@Falador: No I havent re-emerged apache - my USE flags for apache:

```

[ Searching for packages matching net-www/apache... ]

[ Colour Code : set unset ]

[ Legend        : Left column  (U) - USE flags from make.conf                     ]

[                  : Right column (I) - USE flags packages was installed with ]

[ Found these USE variables for net-www/apache-2.0.55 ]

 U I

 + - apache2        : Chooses Apache2 support when a package supports both Apache1 and Apache2

 - - debug          : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too

 - - doc            : Adds extra documentation (API, Javadoc, etc)

 - - ldap           : Adds LDAP support (Lightweight Directory Access Protocol)

 - - mpm-leader     : (experimental) Leader MPM - leaders/followers varient of worker MPM

 - - mpm-peruser    : (experimental) Peruser MPM - child processes have seperate user/group ids

 - - mpm-prefork    : Prefork MPM - non-threaded, forking MPM - similiar manner to Apache 1.3

 - - mpm-threadpool : (experimental) Threadpool MPM - keeps pool of idle threads to handle requests

 - - mpm-worker     : Worker MPM - hybrid multi-process multi-thread MPM

 - - no-suexec      : Don't install suexec with apache

 - - selinux        : !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur

 + + ssl            : Adds support for Secure Socket Layer connections

 - - static-modules : Build modules into apache instead of having them load at run time

 - - threads        : Adds threads support for various packages. Usually pthreads

```

@smity: Im was using "session" in dev-lang/php but in dev-php/php there is no use flag "session"  :Sad:  When I try to access squirrelmail I get the following error in apache error_log:

```

[Mon Jan 30 09:49:27 2006] [notice] child pid 26134 exit signal Illegal instruction (4)

```

I dont get "Fatal error: Only variables can be passed by reference in /usr/share/webapps/squirrelmail/1.4.5/htdocs/functions/imap_messages.php on line 480" "

I looked for the function parsePriority but Im using 1.4.5-r1 and it looks like this:

```

function parsePriority($sValue) {

    $aValue=split('/\w/',trim($sValue));

    $value = strtolower(array_shift($aValue));

    if ( is_numeric($value) ) {

        return $value;

    }

    if ( $value == 'urgent' || $value == 'high' ) {

        return 1;

    } elseif ( $value == 'non-urgent' || $value == 'low' ) {

        return 5;

    }

    return 3;

}

```

Do I have to set php USE flag "imap"?

----------

## smity

when I was migrate to PHP5, I unemerge all dev-php/php and emerge dev-lang/php (PHP5). No more.

( I don't following the documentation for the migration. )

I have add some use flag in apache and php like "+mpm-worker +threads" for apache and "+cgi +dba +session +posix" for php.

dba flag is very importante for php.

if it can help you, this is my use flag for apache and php

net-www/apache-2.0.55-r1  +apache2 -debug -doc +ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool +mpm-worker -no-suexec (-selinux) +ssl -static-modules +threads

dev-lang/php-5.0.5-r5  -adabas -apache +apache2 -bcmath +berkdb -birdstep +bzip2 -calendar -cdb +cgi -cjk -cli +crypt -ctype +curl -curlwrappers -db2 +dba -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob +exif -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase +ftp +gd -gd-external +gdbm -gmp -hardenedphp -hyperwave-api -iconv +imap -informix -inifile -interbase -iodbc -ipv6 -java-external -kerberos +ldap -libedit -mcve +memlimit +mhash +ming -mnogosearch -msql -mssql +mysql -mysqli +ncurses +nls -oci8 -oci8-instant-client -odbc -oracle7 -ovrimos -pcntl +pcre -pdo-external -pfpro -pic +posix +postgres -qdbm +readline -recode -sapdb +sasl +session -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid +spell -spl -sqlite +ssl -sybase -sybase-ct -sysvipc +threads -tidy +tiff -tokenizer +truetype -wddx +xml -xmlrpc -xpm -xsl -yaz -zip +zlib

and you had to change your /etc/conf.d/apache2 for using php5. ( -D PHP5 )

APACHE2_OPTS="-D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D PHP5 -D SSL -D USERDIR"

( I think it is ok for you )

and remove /etc/apache2/modules.d/70_mod_php.conf

( I think you have done this  :Wink:  )

In conclusion, try to unmerge dev-php/* and emerge only dev-lang/php and using only php5

( My Squirrelmail Work very fine so it must be work for you).

----------

## AMSch

And suirrelmail works for you with PHP5?

----------

## smity

yes !   :Wink: 

----------

## jhunholz

Make sure you're using the latest verion...a new one came out just yesterday I believe (1.4.5-r1).

----------

## AMSch

I tried to do so, but:

```

onfigure: error: Ming library 0.2a or greater required.

!!! ERROR: dev-lang/php-5.1.1 failed.

Call stack:

  ebuild.sh, line 1894:   Called dyn_compile

  ebuild.sh, line 941:   Called src_compile

  php-5.1.1.ebuild, line 128:   Called src_compile_normal

  php-5.1.1.ebuild, line 239:   Called php5_1-sapi_src_compile

!!! configure failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

```

But I do have installed:

```

*  media-libs/ming

      Latest version available: 0.2a-r2

      Latest version installed: 0.2a-r2

      Size of files: 309 kB

      Homepage:      http://www.opaque.net/ming/

      Description:   A OpenSource library from flash movie generation

      License:       LGPL-2.1

```

----------

## fvant

looks like you have an issue with php5, not squirrelmail per se.

Have you followed  this guide to upgrade to php5 ?

----------

## AMSch

Yes I did - still no success  :Sad: 

----------

## fvant

Do you need ming ?  is cheating in a way, i know

----------

## AMSch

Well - to be honest im totally confused now  :Wink: 

I just want to install squirrelmail on my apache webserver in order to run squirrelmail. I dont know what "ming" is  :Smile: 

Thanks!

----------

## fvant

ehh, this ming

 *AMSch wrote:*   

> I tried to do so, but:
> 
> But I do have installed:
> 
> ```
> ...

 

----------

## AMSch

Ok - so I guess I dont need it because I dont know what it is or what to do with it.

----------

## eltech

Just confirming that i had this same problem, but re-emerging dev-lang/php with USE="session" did fix the problem..

thanks..

----------

## AMSch

I have re-emerged squirrelmail and php today but it still does not work - bothing happens in browser and apache tells me 

```

[Thu Apr 06 20:18:14 2006] [notice] child pid 32201 exit signal Illegal instruction (4)

```

----------

## AMSch

I found out now what the problem was: a RAM module was damaged - now it works!

----------

