LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2004, 05:56 PM   #1
wellmt
Member
 
Registered: Oct 2003
Location: Oxford, England
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
PHP: Call to undefined function: session_start()


Hello

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:

<?php
echo "this is a PHP line";
phpinfo();
?>

Some of the output from phpinfo is below. What is this -- disable session and --without mysql stuff?

Configure Command:
'./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

Last edited by wellmt; 05-31-2004 at 05:57 PM.
 
Old 05-31-2004, 08:08 PM   #2
linux_pioneer
Member
 
Registered: May 2003
Distribution: Solaris 10, Solaris 8.0, Fedora Core 3
Posts: 203

Rep: Reputation: 30
Re: PHP: Call to undefined function: session_start()

Quote:
Originally posted by wellmt

Some of the output from phpinfo is below. What is this -- disable session and --without mysql stuff?

Configure Command:
'./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 [/B]
wellmt,

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
 
Old 06-01-2004, 05:50 AM   #3
wellmt
Member
 
Registered: Oct 2003
Location: Oxford, England
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
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 :-(

Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Call to undefined function imagettfbbox() QtCoder Programming 24 01-18-2012 12:20 PM
PHP: call to undefined function preg_match() (I think to do with PCRE) BuckRogers01 Linux - Software 1 10-17-2005 01:35 PM
Call to undefined function domxml_open_mem() apt Programming 2 04-01-2005 03:25 AM
Fatal Error - Call to undefined function : pg_pconnect() in filename.php on line xx mwpeng Linux - Newbie 1 02-26-2005 08:57 AM
Call to undefined function: mail() in PHP pembo13 Fedora 0 07-28-2004 07:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration