user2201234
user2201234

Reputation: 61

Session_start function missing in PHP

This code explains the my issue in brief. The session_start function doesn't exist in php. It should!

<?php
if (!function_exists('session_start'))
            $error = 'error_session_missing';
echo "<h1>$error</h1>";

HTML output:

<h1>error_session_missing</h1><!DOCTYPE html PUBLIC "-//W3C//DTD ...cut...

I've scoured the net for solutions - all related seem to be geared towards not using session_start correctly, and the php docs have not helped resolve the issue. I have combed php.ini, tried various re-compile options with php5 - but no matter what, this error persists.

What could possibly cause this function not to exist?

Solution: cd /usr/ports/www/php5-session/ && make install clean

Upvotes: 6

Views: 418

Answers (1)

Just install the php5_session module.

cd /usr/ports/www/php5-session
make install clean

and restart apache / php process

A bit more on this at http://www.freebsdmadeeasy.com/tutorials/web-server/install-php-5-for-web-hosting.php

Upvotes: 2

Related Questions