cpanel: connection is not private and Warning - php

session_start(): Cannot send session cache limiter - headers already sent (output started at)
Every time I login to my cpanel, it always say connection is not private. So, what I do is to click the link on the advance option, then whenever I upload php files it always say:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at directory file)
Even though there's no error in my code, it functions well but, the warning keeps bothering me, please help!

For the cPanel login, Please check your cPanel services SSL Certificates if you have root access, As there is an issues with the cPanel SSL and due to that you are unable to login your cPanel.

Related

How to fix session problems on web host when header location change?

When execute header("Location: new/location.php") command I got session problems.
On local host testing everything works just perfect, but if i send my project on web server hosting i got these errors:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /srv/disk4/2008248/www/some-url.com/new/location.php:2) in /srv/disk4/2008248/www/some-url.com/new/location.php on line 7
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /srv/disk4/2008248/www/some-url.com/new/location.php:2) in /srv/disk4/2008248/www/some-url.com/new/location.php on line 7
, so my question is how to fix this problems and keep session values alive, so i can use that values in another redirected page?
Warning: session_start(): Cannot send session cookie - headers already... a typical error when something is before session_start()
You need to write session_start() above headers(). As error says you already sent something beforee session start. Make Session start the very first line of your script, and leave no spaces before <?php tag
use ob_start(); on top of the php page

PHP Session issue only on GoDaddy (Warning: session_start(): Cannot send session cookie)

I am currently working on a user registration system for a client on GoDaddy hosting.
I have previously never had this sort of issue before on Hostgator and while testing locally on a PHP test server on OS X.
It's a fairly simple script too. common.php accesses the MySQL database, all of the pages (login, register, etc.) include common.php. Sessions start when the user logs in, etc.
I see the following errors at the top of the page:
Warning: session_start(): open(/home/content/10/12114910/tmp/sess_trmok9fgtb527mjp21a76shf54, O_RDWR) failed: No such file or directory (2) in /home/content/10/12114910/html/common.php on line 86
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/10/12114910/html/common.php:86) in /home/content/10/12114910/html/common.php on line 86
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/10/12114910/html/common.php:86) in /home/content/10/12114910/html/common.php on line 86
The following errors are at the bottom of the page.
Warning: Unknown: open(/home/content/10/12114910/tmp/sess_trmok9fgtb527mjp21a76shf54, 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
Once again, this is only a GoDaddy issue. My client was originally on Windows hosting and this just did not even work at all and I switched them to Linux hosting.
They were on PHP version 5.3 and I changed it to 5.4 and I have still had no luck.
I have never messed with a php.ini file. Would I need to create one? I have heard that uploading it into the public_html folder overrides the one on the server even though we are on a shared hosting plan.
Would I also need SSH access to create a tmp folder and set proper permissions for it?
This is usually quite easy to fix on crappy providers (I don't recommend GoDaddy, by the way).
Here is how I'd go about fixing it, hopefully it will help you.
Step 1: Make a directory and call it _sessions or something of that
nature.
Step 2: Give it a chmod of 775 so that the web server can write to it.
Step 3: On the first script that runs, right at the top place session_save_path("./_sessions");
Step 4 (optional, but recommended): Add either deny from all in a .htaccess file to prevent people from getting to the directory, or simply chmod 776.
Find out more about session_save_path() here: php.net/session_save_path

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?

Cakephp Session errors after deploying the cms part of my web blog

I have a CakePhp 2.0 blog app installed on netfirms server, the blog is working fine with the PostsController defining terms used by the blog, when I now added actions like edit, add, and delete posts, edited my models with beforeSave() callbacks and added a new controller GalleriesController with the same functionality of deleting images , modifying or adding new ones, then when any cms action takes place whether it is post editing or modification or image editing or modification I receive this errors on the webserver which doesn't show on my local WAMP server installation
Warning (2): session_start(): open(/var/php_sessions/sess_d876a0afa32835689eafbf4a111b60bd, O_RDWR) failed: No such file or directory (2) [CORE/Cake/Model/Datasource/CakeSession.php, line 615]
Warning (2): session_start() [http://php.net/function.session-start]: Cannot send session cookie - headers already sent by (output started at /hermes/bosweb25b/b952/nf.accountname/public_html/lib/Cake/Utility/Debugger.php:776) [CORE/Cake/Model/Datasource/CakeSession.php, line 615]
Warning (2): session_start() [http://php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb25b/b952/nf.accountname/public_html/lib/Cake/Utility/Debugger.php:776) [CORE/Cake/Model/Datasource/CakeSession.php, line 615]
Warning (2): Unknown: open(/var/php_sessions/sess_d876a0afa32835689eafbf4a111b60bd, O_RDWR) failed: No such file or directory (2) [Unknown, line 0]
Warning (2): Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/php_sessions) [Unknown, line 0]
When you load your app it tries to create a session file in that location. Obviously it is struggling with that probably due to some permission issues on your server. (Probably your local machine had admin rights so this wasnt an issue)
I find it easier to manage the sessions within the cake app itself.
If you edit core.php. Change the Session configuration entry to look something like the below:
Configure::write('Session', array(
'defaults' => 'cake',
'cookie' => 'myapp',
'timeout' => 4320 //3 days
));
It will store the session files in here: app/tmp/sessions which your app should have access to. Also it will rename your cookie to myapp and set the timeout
You can find more info here: http://book.cakephp.org/2.0/en/development/sessions.html

why am i getting the cannot send session cookie error on my php webpage when it is in an online webserver?

i have a perfectly working site in my local machine, which was developed using WAMP server. I tried moving it over to a webost, and i keep getting this message in my pages -
Error -
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent by (output started at /www/host.com/appi/htdocs/connect.php:11) in <b>/www/host.com/appi/htdocs/session-public.php</b> on line <b>5</b><br />
<br />
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /www/host.com/appi/htdocs/connect.php:11) in <b>/www/host.com/appi/htdocs/session-public.php</b> on line <b>5</b><br />
I have a session start to be set if not already set, in all my pages.
My question is, if it works in my local machine, why this error when the same code is moved over to a shared web server online?
PHP has a lot of configuration options that allow you to configure PHP from outside of a running script. One of them is output_buffering that allows you to implicitly buffer any output before sending it to the client.
If output buffering is enabled, you can modify the HTTP header even after some output as the output is buffered and not immediately sent to the client that would implicate sending of the HTTP header before.
So it seems that your local machine has output_buffering enabled while your other server hasn’t.

Categories