Hi everyone. I am currently working on making a local web server to do testing for our site before uploading. I have never had to install or configure anything before. So this whole project is a big learning experience for me. I am currently getting an error on our test site:

Fatal error: Call to undefined function session_start()

I have installed Apache 2.2, FreeBSD 6.0, PHP5, PHP5-extensions, MySQL 5.0.17. These were installed using the ports on FreeBSD.

There have been a few people who said that session.so is not loaded, but I installed PHP5-extensions, which is what was suggested and still no luck. I checked my /php/extensions.ini file and I found the line:

extension=session.so

I checked my php.ini file and the extension_dir is set to /usr/local/lib/php/, which is where my extensions.ini file is located. When I change it to /usr/local/lib/php/20050922-debug/, which is where my .so files are located, the test site doesn't even pull up.

I installed php through the freebsd ports, so I did not use the ./configure command. I tried to do a ./configure --help, but got an error message saying that the ./configure command was not found.

Here is my ./configure on the phpinfo()

'./configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl' '--with-regex=php' '--with-apxs2=/usr/local/sbin/apxs' '--enable-debug' '--enable-zend-multibyte' '--prefix=/usr/local' 'i386-portbld-freebsd6.0'

Is there anyway I can make sure that sessions is enabled without having to do a ./configure? Any help or direction will help me a lot.

Thank you.

    could be anything...but usually session_start() is enabled by default in php.ini so you shouldn t have to modify anything there or get extensions.

    Stupid question, but have you made sure that you always call session_start() is on your first line of coding ??

      Thank you for your response.

      All of our calls to session_start is on the line directly after '<?php' , line 2. Everything is working on our live server, so I didn't think it would be a problem with the code. I'll try to play around with it. Would there be a difference between php4 and php5?

      I'm actually thinking of reinstalling php5.

      Again, thank you for your help.

        Try making a test script, with a call to phpinfo(). eg;

        <?php
          phpinfo();
        ?>
        

        This will atleast inform you as to weather or not sessions are enabled. doesn't sound like they are, but your best to check first.

          Hi thorpe.

          Here is my ./configure on the phpinfo()

          './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl' '--with-regex=php' '--with-apxs2=/usr/local/sbin/apxs' '--enable-debug' '--enable-zend-multibyte' '--prefix=/usr/local' 'i386-portbld-freebsd6.0'

          I noticed that there is a '--disable-all' . I tried to run ./configure --help to see if I can do an enable-session, but I don't have ./configure installed. I'm actually searching on how to install this now.

            Actually, Ive just noticed you have a '--disable-all' in your ./configure. Im not 100% sure what this does exactly, but It may well disable all configuration options except those that you explicitly define.

            Cant seem to find any docs on it, and Im not at my machine to check. Run .configure --help to find out what it does exactly. Sessions are enabled by default unless you explicitly disable them.

              Hehe... beat me to it.

              Im not sure how the BSD ports system works, but I assume you can pass compile options to it somehow. I would find out how, and disable the '--disable-all' option and rebuild.

                Just wanted to update my post in case someone has the same problem in the future.

                I uninstalled php5 and all the php5-extensions. Then I went into the php5 ports and did:

                make CONFIGURE_ARGS+="--your-option" configure

                make install clean

                Then 'cd' into php5-extensions, 'make install clean'.

                For some reason after I did the 'make CONFIGURE_ARGS...", the install didn't perform as DSO, so I had to add '--with-apxs2=/usr/local/sbin/apxs' as one of my options.

                Thanks to everyone for the help and suggestions.

                  Write a Reply...