PHP: Call to undefined function: session_start()
I'm new new to using Linux (using SuSE) and would like to continue developing my Apache/PHP/MySQL stuff that I worked on under Windows...Is there a simple step by step guide to installing this combo somewhere? (pref. using RPM)
Here is the problem:
I've installed Apache 2.0 with the PHP module and MYSQL. Apache appears to be running OK as I can enter http://localhost and will get an index not found message (as I didn't install example pages.) So I copied all my PHP web site stuff into /srv/www/htdocs
Now when index.php is displayed by Apache I get the following error message.
Fatal error: Call to undefined function: session_start() in /srv/www/htdocs/index.php on line 3
PHP appears to be being parsed correctly as I can run a PHP test page using the following code:
echo "this is a PHP line";
Some of the output from phpinfo is below. What is this -- disable session and --without mysql stuff?
'./configure' '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' '--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux'
Setting this up under seems a lot easier...what am I missing!
Thanks for any help
Re: PHP: Call to undefined function: session_start()
the function session_start() is a php session handling function that perserves data as users browse your web site moving from one page to the next. Its very handy although there are other ways to perserve data. You can either recompile php and configure it NOT disabling session or you can take the calls to the session_start() function out of your code.
If you want to go with the latter, calls to session_start() are located at the very beginning so just look for the <?php start tag. May have a few set_cookie() calls and variable assignments ahead but you can find session_start().
hope this helps
Thanks for the reply linux_pioneer.
I'm well aware of what sessions do, as my website relys on them. I don't intend to recode my entire web site, so I'd like to enable session handling in PHP...
So are you saying that the --disable session and the --withoutmysql are compilation options that have been made by SuSE? They seem like pretty stupid ones to me, but maybe I'm missing something.
It seems crazy that I have to recompile PHP, yet on a Windows box, setting this stuff up takes about 10 minutes :-(
|All times are GMT -5. The time now is 11:56 PM.|