# No session support in default PHP installation



## aurora (Mar 22, 2010)

Hello

I've just installed PHP from ports collection  and it installed itself as PHP 5.2.12. Now everything seems fine because when I type several basic PHP lines (e.g. <?php phpinfo(); ?>)
it works. 

But later when I attempted to install a CMS program called MODx, because it contained the function session_cache_limiter() in its install script, the PHP gave this error:

_Fatal error: Call to undefined function session_start() in /Library/WebServer/modx/install/index.php on line 12_

and so I stopped there and examined the phpinfo page.  Another PHP (5.2.12) installation which works correctly in another server (Mac OS X 10.5.8), I noticed a section called Session and it started with "Session Support: 	enabled"

In my FreeBSD PHP, there's no mention of such a support at the phpinfo page. 

For your information here is the Configure Command of my FreeBSD server:


```
'./configure' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php'
 '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' 
'--program-prefix=' '--enable-fastcgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-
regex=php' '--with-zend-vm=CALL' '--prefix=/usr/local' '--mandir=/usr/local/man' 
'--infodir=/usr/local/info/' '--build=i386-portbld-freebsd7.2'
```

And for the purpose of comparison, here's the Configure Command of the other server (MAC OS X 10.5.8) on which PHP is working without any problem:


```
'/SourceCache/apache_mod_php/apache_mod_php-44.2/php/configure' '--prefix=/usr' 
'--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' 
'--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' 
'--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' 
'--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-
iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' 
'--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr' 
'--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'
```

I think I will have to recompile the PHP to support the "session" but I don't know how to do it, i.e. which configuration option to use or should I use anything else?

Thanks.


----------



## DutchDaemon (Mar 22, 2010)

It's a config option in lang/php5-extensions.


----------



## aragon (Mar 23, 2010)

Or www/php5-session.


----------

