This is Interesting: Free IT Magazines  
Home > Archive > Gentoo Linux forum > March 2005 > Upgrading PHP to version 5: Sessions not working...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Upgrading PHP to version 5: Sessions not working...
Wim Cossement

2005-03-15, 7:45 am

Hi,

I've run emerge -Du world lately and now when I adjusted the Apache2
configuration to use the new php 5 instead of php 4 I noticed that it
does not have sessions compiled into it.

So I ran USE="session mysql apache2" emerge -av mod_php (also did this
for CLI PHP) but it still produces this:
Fatal error: Call to undefined function session_start() in
/blah/blah/init.php on line 35

This is in my package.use file, but that should not be a problem, right?
=dev-php/mod_php-5.0.3 -berkdb -gdbm
=dev-php/php-5.0.3 -berkdb -gdbm

PHP should have been compiled using these flags (most of them come from
make.conf):
+apache2 +crypt +curl +fam +gd +jpeg +ldap +mysql +ncurses +nls +png
+readline +sasl +session +sqlite +ssl +tiff +truetype +xml2 +zlib

For the rest php works fine...

Regards,

Wimmy
J.O. Aho

2005-03-15, 7:45 am

Wim Cossement wrote:
> Hi,
>
> I've run emerge -Du world lately and now when I adjusted the Apache2
> configuration to use the new php 5 instead of php 4 I noticed that it
> does not have sessions compiled into it.
>
> So I ran USE="session mysql apache2" emerge -av mod_php (also did this
> for CLI PHP) but it still produces this:
> Fatal error: Call to undefined function session_start() in
> /blah/blah/init.php on line 35


I have the following in my make.conf

USE="3dnow alsa cjk dedicated ffmpeg imap innodb Java javascript joystick \
leim mmx nowin nptl nvidia passfile sse tiff transcode usb v4l \
vim-with-x dvdr cups foomaticdb ppds usb -lirc bitmap-fonts \
-boundschecking wmf xfs xft xvid -postgres -motif"

and my php5 (5.0.3) has sessions.

> This is in my package.use file, but that should not be a problem, right?
> =dev-php/mod_php-5.0.3 -berkdb -gdbm
> =dev-php/php-5.0.3 -berkdb -gdbm


It could be that sessions needs a database of some sort, I don't know.



//Aho
Wim Cossement

2005-03-15, 7:45 am

> I have the following in my make.conf
>
> USE="3dnow alsa cjk dedicated ffmpeg imap innodb Java javascript joystick \
> leim mmx nowin nptl nvidia passfile sse tiff transcode usb v4l \
> vim-with-x dvdr cups foomaticdb ppds usb -lirc bitmap-fonts \
> -boundschecking wmf xfs xft xvid -postgres -motif"
>
> and my php5 (5.0.3) has sessions.


I'll use those flags to compile it and test it.
For now, I've recomplied php 4.3.10, and this works fine, I'll take a
look at the different use flags in them.

> It could be that sessions needs a database of some sort, I don't know.


No, not realy

I'll keep in touch...
Wim Cossement

2005-03-15, 7:45 am

> I'll use those flags to compile it and test it.
> For now, I've recomplied php 4.3.10, and this works fine, I'll take a
> look at the different use flags in them.


I haven't found what it is yet, it must have something to do with those
use flags, buio now I've also screwed up the apache2 config when tying
to use five, so I'll have to do it another time cause they need some php
script on it :-/
Markus Malkusch

2005-03-15, 7:45 am

Wim Cossement:

> php should have been compiled using these flags (most of them come from
> make.conf):
> +apache2 +crypt +curl +fam +gd +jpeg +ldap +mysql +ncurses +nls +png
> +readline +sasl +session +sqlite +ssl +tiff +truetype +xml2 +zlib


When you recompiled, you restarted your apache? So what says phpinfo() about
your configure parameters?

What about your php.ini? Is it configured correctly? Can we have a look at a
phpinfo()?
--
<http://bav.malkusch.de/> - Kontonummerprüfung mit PHP
Wim Cossement

2005-03-15, 5:45 pm

Markus Malkusch wrote:

> Wim Cossement:
>
>
>
>
> When you recompiled, you restarted your apache? So what says phpinfo() about
> your configure parameters?
>
> What about your php.ini? Is it configured correctly? Can we have a look at a
> phpinfo()?


Well, I'm back to version 4.x now, but if someone could tell me how to
slot 4.x and 5.x I'll give U an answer, because I don't know how to slot
packages...

Wim
Rainmaker

2005-03-16, 2:45 am

Op Tue, 15 Mar 2005 15:15:17 +0100, schreef Wim Cossement:

> Markus Malkusch wrote:
>
>
> Well, I'm back to version 4.x now, but if someone could tell me how to
> slot 4.x and 5.x I'll give U an answer, because I don't know how to slot
> packages...
>
> Wim


mkdir -p /usr/local/portage/dev-php/mod_php
cp -R /usr/portage/dev-php/mod_php/* /usr/local/portage/dev-php/mod_php

This is to move the ebuilds to your local portage, which won't get
overwritten when you emerge sync

Then edit the ebuilds.

Put SLOT="4" and SLOT="5" above the src_unpack function in the ebuilds.
These ebuilds have some kind of checking mechanism to set the SLOT to the
version of apache. Therefor, you'll have to put this line below this
chacking function, thereby overwritting the calculated SLOT value.

Not sure if 2 versions of php on the same machine will work though. You
might end up breaking both versions...

Markus Malkusch

2005-03-16, 2:45 am

Rainmaker:

> Not sure if 2 versions of php on the same machine will work though.


mod_php won't work on one apache.
--
<http://bav.malkusch.de/> - Kontonummerprüfung mit PHP
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2010 webservertalk.com