简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM