Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2004, 07:40 PM
Registered User
 
Join Date: Jul 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem - PHP - localhost

Hello,

I’m having trouble activating PHP scripts on my testing server. (localhost) I have Apache, PHP and MySql installed and I get the “If this works we really did it” returned to me that is supposed to indicate that the three programmes are working.

At the moment I am trying to get a login page to work. (Beginning PHP, Apache, MySQL Web Development, Chapter 11 page 322). I have the three pages completed ‘template.php’, ‘auth.inc.php’ and ‘login.php’. However when I launch my template page I get this information at the top of the login.php page that appears.

Notice: A session had already been started - ignoring session_start () in C:\Program Files\Apache Group\Apache2\test\auth.inc.php on line 2

I can fill in the username and password, hit enter and then get that same message again.

I can run those same files on my remote server without any problems at all, so there does not appear to be anything wrong with the files. It’s just on my localhost where I have difficulty so it must have something to do with the local installation or configure files but I’ve gone through them several times and can’t find anything.

Any suggestions would be very much appreciated.

Peter

 
Old December 11th, 2004, 10:11 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Check php.ini, is session.auto_start set to 1 or 0?

Also make sure you haven't called session_start() more than once on the same page.

hth,

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old December 12th, 2004, 11:48 AM
Registered User
 
Join Date: Jul 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,
Thank-you for responding. I checked php.ini session.auto_start and it was set to '0'. I tried it at '1', but it didn't make any difference so I changed it back to '0' I checked to make sure that I don't have session_start more than once on a page.

What I do have:

At the top of the auth.inc.php page is:

session_start();
if ($_SESSION['logged'] != 1)


At the top of the login.php page is:

session_start();
$_SESSION['logged'] = 0;

In addition: the login guards a search page which has a php search engine. Again this works just fine on the remote server but the search function will not work on localhost?

Thank-you again, Peter






Similar Threads
Thread Thread Starter Forum Replies Last Post
vista website Problem on localhost sweetdude Classic ASP Databases 0 March 24th, 2008 11:18 AM
Localhost connection problem Jakob Internet Information Services 0 March 7th, 2007 04:42 PM
problem deploying to work/standalone/localhost leonbrits Apache Tomcat 0 August 26th, 2005 07:22 AM
Localhost Yee Dreamweaver (all versions) 6 October 21st, 2004 09:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.