Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session_start function missing in PHP

Tags:

php

session

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

like image 682
user2201234 Avatar asked Mar 23 '13 01:03

user2201234


Video Answer


1 Answers

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

like image 159
Marcos Besteiro López Avatar answered Sep 30 '22 23:09

Marcos Besteiro López