Warning: session_start() [function.session-start] - php

Hi I would really appreciate some help. I get the following errors at http://www.bookapartmentsinyork.co.uk/
Warning: session_start() [function.session-start]: open(/home/content/05/11475705/tmp/sess_o4ml0j7uuo01pffbonlpdpi8p2, O_RDWR) failed: No such file or directory (2) in /home/content/05/11475705/html/wp-content/plugins/quitenicebooking/includes/quitenicebooking.class.php on line 141
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/05/11475705/html/wp-content/plugins/quitenicebooking/includes/quitenicebooking.class.php:141) in /home/content/05/11475705/html/wp-content/plugins/quitenicebooking/includes/quitenicebooking.class.php on line 141
I have tried so many thing but it's all got pretty confusing for me. I'm using GoDaddy,
The error was caused after changing from a Windows to Linux server. I am very new so please try to help me in your explanations as I may get confused easily :) Thank you!

It looks like the 'quitenicebooking' plugin is trying to read session storage data which does not exist.
The subsequent errors regarding headers already sent is just a consequence of the fact that the first error appears.
You could try changing the session storage location using ini_set().

Be sure to set session_start() at the very beginning of your file.
You're getting this error because the header are already sent.

Related

Opencart Errors

I am having issues with my Opencart shop (version 2.0). I have not made any changes in a few days and my hosting company don't work weekends... and something always seems to go wrong on weekends.
When I try to log in to my admin panel I get this error:
Warning: session_start():
open(/tmp/sess_6944b43ff0351f3609154764b353ba7c, O_RDWR) failed:
Permission denied (13) in
/home/thespace/public_html/system/library/session.php on line
23Warning: session_start(): Cannot send session cache limiter -
headers already sent (output started at
/home/thespace/public_html/admin/index.php:165) in
/home/thespace/public_html/system/library/session.php on line 23
The front end of the website works with the exception of the checkout... It gives me this error when trying to access it:
Warning: session_start():
open(/tmp/sess_6944b43ff0351f3609154764b353ba7c, O_RDWR) failed:
Permission denied (13) in
/home/thespace/public_html/system/library/session.php on line
23Warning: session_start(): Cannot send session cache limiter -
headers already sent (output started at
/home/thespace/public_html/index.php:207) in
/home/thespace/public_html/system/library/session.php on line
23Warning: Cannot modify header information - headers already sent by
(output started at /home/thespace/public_html/index.php:207) in
/home/thespace/public_html/vqmod/vqcache/vq2-system_engine_controller.php
on line 28Warning: Cannot modify header information - headers already
sent by (output started at /home/thespace/public_html/index.php:207)
in
/home/thespace/public_html/vqmod/vqcache/vq2-system_engine_controller.php
on line 29
Fatal error: Call to a member function get() on a non-object in
/home/thespace/public_html/index.php on line 205
I have tried googling the issue but can't seem to find a resolve. I did notice that there was no public_html/vqmod/vqcache/vq2-system_engine_controller.php file in my vqcache and I've tried restoring an old backup of the site but that hasn't worked either!
Really need help with this.
Try deleting all files of vqmod/vqcache and delete the file vqmod/mods.cache
First you need to check that is there vqmod in the site if it is then :
1) delete the mods.cache and checked.cache file from vqmod folder
2) delete all cache files from vqmod/vqcache
second check there is any Extension installed through OCMod if any then Go to Admin and clear and refresh the modification.
I think these will help because it helps me once.
It seems the plugin/extension you have installed using VQMOD/OCMOD is not working properly somehow.
Here are some ways to show the error message:
1. Set your “Output Compression Level” to 0 in the System > Settings > Server tab.
2. Then open php.ini and add code below:
I. display_errors = 1;
II. error_reporting = E_ALL;
III. log errors = 1;
3. If your server not read the php.ini, we will use an alternative method. Open index.php and add code below at the top (line 2):
I. ini_set('display_errors', 1);
II. ini_set('log_errors', 1);
II. error_reporting(E_ALL);
4. Once you have fixed the problem, remove the above code.
If It's just warning then You should do inverse process.
You have to disable display error using Admin Panel of Opencart Application.
delete vqcache
delete mods.cache
delete checked.cache
clear modification
Amy is right. This just helped my friend.

Is it normal for hosting company to disable sessions on server?

I have just moved over to a linux server on my shared hosting to see if it is less rubbish than a windows server on godaddy (I have been stupid enough to have paid them 12 months up front so I am stuck with those idiots now). I am now no longer able to use any kind of sessions at all.
They have got back to me saying that it is up to me to resolve the issue to get it to work... yes that is right... TO GET SESSIONS TO WORK! Excuse me if I seem a little irate but I am furious.
Can someone please inform me how I can in some way get sessions to work on an Apache server? I have never had to set this up before because it has never been a problem. As soon as I do:
<?php session_start() ?>
... it is just coming up with about 8 lines of errors saying that:
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/30/10247530/tmp/sess_sgruthqkbhfms6ekcle2l0n6i5, O_RDWR) failed: No such file or directory (2) in /home/content/30/10247530/html/sessionthing.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/30/10247530/html/sessionthing.php:2) in /home/content/30/10247530/html/sessionthing.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/30/10247530/html/sessionthing.php:2) in /home/content/30/10247530/html/sessionthing.php on line 2
Warning: Unknown: open(/var/chroot/home/content/30/10247530/tmp/sess_sgruthqkbhfms6ekcle2l0n6i5, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
I have tried creating a php.ini file and I still cannot get it to work properly. I have checked the settings using phpinfo() and I genuinely do not know where to go from here.
EDIT: There are a few things appearing down the side of the page now pointing to similar problems. For some reason I did not come up with those when I did a search. One of them is even closed: https://stackoverflow.com/questions/11374110/session-start-errors-on-godaddy-server?rq=1
That one says that they got it resolved with Godaddy so I think I will have to go back to them and tell them to sort it out. It is not that I do not want to learn how to configure the server... it is just that sessions should just work.
Make sure that there are no other <?php session_start() ?> declared, and try set your own session temp path,
<?php
if (!is_dir(session_save_path())) {
session_save_path ('your/custom/existing/directory');
}
session_start();
?>
PHP is trying to save the session in /var/chroot/home/content/30/10247530/tmp/, and it can't open that directory (either because it doesn't exist or because it doesn't have write permissions to it). Investigate PHP's access to this path and I believe that you'll get your sessions working - maybe you overlooked a config variable when you migrated your code to the new server?

strange php session error

I get a session error which I did not have before which is strange.
Warning: session_start() [function.session-start]: open(/tmp/sess_6768c4a8b1cff40d24a3a87de701c865, O_RDWR) failed: Read-only file system (30) in /home/public_html/ctcms/index.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/public_html/ctcms/index.php:4) in /home/public_html/ctcms/index.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/ctcms/index.php:4) in /home/adrian/public_html/ctcms/index.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/ctcms/index.php:4) in /home/public_html/ctcms/library/CT/Controller.php on line 40
Warning: Unknown: open(/tmp/sess_6768c4a8b1cff40d24a3a87de701c865, O_RDWR) failed: Read-only file system (30) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0`
I have only session_start(); in my index.php at line 4. How can I fix this?
Your /tmp/ folder isn't writable. Make it writable.
chmod u+w /tmp/
You can test it with is_writable(session_save_path()).
Warning: session_start() [function.session-start]: open(/tmp/sess_6768c4a8b1cff40d24a3a87de701c865, O_RDWR) failed: Read-only file system (30) in /home/public_html/ctcms/index.php on line 4
It looks like /tmp is on a read-only file system. This is not normal. Tell your sysadmin/hosting provider to have a look at it; the machine may have a serious problem.
If the machine is yours, check the logs for any errors related to the file system and try to remount the disk in read-write (mount -o remount,rw /dev/yourdevicehere).
Yuo can't write on /tmp/
Make it writable and redo the operation.
Moreover, remember that session_start() have to be the first operation that you do on the page.
Take a look: php manual
This was a known bug in version(s) of PHP . Depending on your server environment, you can try setting the sessions folder to 777:
/var/lib/php/session (your location may vary)
I ended up using this workaround:
session_save_path('/path/not/accessable_to_world/sessions');
ini_set('session.gc_probability', 1);
You will have to create this folder and make it writeable. I havent messed around with the permissions much, but 777 worked for me (obviously).
Make sure the place where you are storing your sessions isn't accessible to the world.
This solution may not work for everyone, but I hope it helps some people!
please select an answer and mark accordingly.

moved php website from linux to Windows

I have to move a website from a shared hosting on Linux to a VPS running Windows.
Nothing works.. but when I add a new line above <?php it works a little bit.
I'm getting errors like headers already sent etc..
Any thoughts on this? Suggestions? This is really getting me pissed..
edit:
0. not seeing anything ( file index.php not found )
1. adding newline , script(index.php) is found.
2. Errors : Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:...config.php on line 134 ( where I start my session )
The Byte Order Mark is probably your problem

Warning: Sessions Permission Denied/Headers Already Sent in PHP

I am a beginner in PHP.
I am receiving the following errors. I cannot view the error from my computer on FF, IE, and Chrome, but yet I see the error up top when browsing from another computer's browser.
Warning: session_start() [function.session-start]: open(/tmp/sess_c464nadk4jsn4u43mpqipkjbr7, O_RDWR) failed: Permission denied (13) in "file location" on line X
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at "file location":line X) in "file location" on line X
Any ideas anyone?
I have the session_start() before the includes which means before any html, and the session is only used to carry over one variable.
I tried placing it before
Header("Cache-control: private, no-cache");
Header("Pragma: no-cache");
but this only generated more Warning signs. Any help would be appreciated!
seems that the /tmp/ dir is not readable or writable by the user php is running as.
Is there any whitespace or any other character before the <?php starting tag?
Is the session_start() really the first statement within the php block?
The "headers already sent" error is caused by the first one. The other answers here trying to debug it aren't going to help you. Fix the first error and the second will go away. The first error tells you what your problem is already - the /tmp directory is not writable by the web server. /tmp is usually 777 (rwxrwxrwx).
The first error seems to indicate missing write permission in the temp directory but could be linked to the second one also.
The second error normally only happens when there is some kind of output is being sent from your php script before the session_start() call, because will automatically send HTTP headers. This can be any kind of html or even blank lines or spaces in the file before the actual call or before the <?php opening bracket. As Shane suggests in a comment, the reason for the second error could very well be that the error message from the first error (unable to write the session to a file in /tmp) causes headers to be sent and thus it is too late to send them with the header() call.

Categories