sieru
Newbie
Karma: 0
Posts: 9
|
 |
« on: February 21, 2009, 07:49:18 AM » |
|
This is what I see when I click the 'check availability' button on 'reserve.php' (making new reservations). The 'check.php' file still seems to produce the correct result (on the availability), despite the warnings being displayed.
"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\phpScheduleIt\check.php:1) in C:\xampp\htdocs\phpScheduleIt\config\init.php on line 39
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\phpScheduleIt\check.php:1) in C:\xampp\htdocs\phpScheduleIt\config\langs.php on line 178
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\phpScheduleIt\check.php:1) in C:\xampp\htdocs\phpScheduleIt\config\langs.php on line 113
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\phpScheduleIt\check.php:1) in C:\xampp\htdocs\phpScheduleIt\config\langs.php on line 114"
Can anybody tell me how to switich it off or resolve it?
I am running the latest version of phpScheduleIt (1.2.10), running it on XAMPP for Windowos, Verion 1.7.0, with PHP v.5.2.8; Apache 2.2.11, and MySQL version 5.1.30. My OS is Vista, which I suspect may be causing this problem. I say this because this same version used to work fine under Win2K, my older PC.
Any help would be appreciated.
Thanks,
Sieru
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5419
|
 |
« Reply #1 on: February 23, 2009, 02:28:20 PM » |
|
The only page this is happening on is check.php?
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #2 on: February 23, 2009, 06:57:48 PM » |
|
Yup, strangely I have no other session related errors. If there are warnings being produced in the background, thy are not being displayed on the web browser. May be they are silently going to the system log, which is disabled by default if I am not mistaken. Interesting, isnt it?
Personally I don't even understand what the error means, like what does it mean 'can't send session cache limiter' or 'cannot modify header information' - which header? What is a session cache limiter? What is being sent? This is all new to me.
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5419
|
 |
« Reply #3 on: February 24, 2009, 01:46:16 PM » |
|
This is usually an indication of something going wrong in the code before the session_start is being called in init.php.
Take a look at your check.php file and make sure there is nothing, including spaces or new lines, before <?php.
You can change line 39 of config/init.php to @session_start(); but this will just mask the underlying problem.
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #4 on: February 24, 2009, 06:42:03 PM » |
|
Sorry, still no change  There is no extra space before the php tagline. Also I turned off the warning reporting at the session start line on init.php (as you suggested). Sieru
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #5 on: February 24, 2009, 07:42:39 PM » |
|
Some new development: I developed two test scripts, one with cookies and another with sesions.
The file with session enabled produced a warning: "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\phpProject\session_ID.php:2) in C:\xampp\htdocs\phpProject\session_ID.php on line 2"
The file with cookies produced the warning: "Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\phpProject\cookie_login.php:9) in C:\xampp\htdocs\phpProject\cookie_login.php on line 22"
This exempts phpScheduleIt from any bugs, though it still does leave me wondering why the PHP Engine is producing these errors. At least now we know the problem may be coming from the php server, or the operating system. I would love to hear from those guys who are running this on Vista...
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #6 on: February 24, 2009, 11:34:51 PM » |
|
OK, this gets stranger by the day. All non-session and non-cookie php files work fine. With no error. Second observation, I put session_start() line of the init.php file from line 39 to line 1, but still keep getting the same error saying the error is coming from line 39 where the session_start() is located?!?! I deleted any emply lines and space before the call to the session, still no change.
One more observation, I had a working script that would create a simple text file and write a line into the file. When I run it, I could not write into the file. So I figured it might have something to do with read/write permission on my vista. So I went changed the permission setting for apache.exe and php.exe to give them read/write/execute permission on all accounts (System, Local, User, Admin). Still no change!
I have also checked several other forums but they all talk about an extra space before the <?php tag which does not apply in my case. None of these files have been modified since the last time I run them on my previous Win2K machine.
I have given up. In the mean time, I have managed to turn off error display and enabled error logging instead to a log file. Confused and mad. It just took my entire night!
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5419
|
 |
« Reply #7 on: February 25, 2009, 02:00:07 PM » |
|
One other thing to check is that PHP has write permission to your session temp directory specified in php.ini.
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #8 on: February 25, 2009, 08:58:20 PM » |
|
How do I specify that other than telling vista to allow php.exe to give it write permission? I thought the permission was system wide, can I do folder-specific write permission?
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5419
|
 |
« Reply #9 on: February 26, 2009, 01:56:15 PM » |
|
Yeap, take a look at where your php.ini session.save_path is pointing to and make sure it is writeable.
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #10 on: February 27, 2009, 10:23:46 AM » |
|
Still no change. I just tried that, which by default was already given write and modify access. The apache process runs under the SYSTEM user permission, which gives it system wide write access. There is no php.exe process on the task list, I think it only gets called during run time. There are a few php related .dll files under the apache/bin folder but I have not touched any of them for permission settings.
|
|
|
|
|
Logged
|
|
|
|
sieru
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #11 on: March 01, 2009, 10:17:49 PM » |
|
I finally found the problem!  The session error was displayed because there were two session_start calls, one in config/lang.php (line 176) and the other in config/init.php (line 39). The later is invoked first, so when it encounters the second call, it complains. Commenting out the call in lang.php solves the problem. The second warning with the header not being writable comes as a result of a configuration switch on the php.ini file. The line "output_buffering=off" should be turned on so that output headers are buffered (including cookies). That is why the system complains whenever the cookie is enabled on the login page. I guess I didn't use cookies when I run it in my old PC or may be it was configured to have buffering. I think the default is on, but somehow I found it off in the vista version of the xampp installation. The connection to reserve.php/check.php is still unclear to me. Thanks for your efforts in trying to resolve the issue with me. Sieru
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5419
|
 |
« Reply #12 on: March 03, 2009, 01:58:52 PM » |
|
Interesting, thanks for the info.
|
|
|
|
|
Logged
|
|
|
|
|