session_start(); Failed Errors on Godaddy

By January 6, 2014Rants, Technology

One thing that really pisses me off  (as in hate & rage) about using WordPress with GodDaddy hosting is all of the little trouble shooting issues I run into on an almost weekly basis with either the default installation or a custom theme installation. session_start(); errors are by far the most common issue I have. In WordPress the errors are usually displayed in sets of three and look something like this:

Warning: session_start() [function.session-start]: open(/home/content/##/##########/tmp/sess_abc123, O_RDWR) failed: No such file or directory (2) in /home/content/##/##########/html/some_path/random_file.php on line ##

Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home/content/##/##########/html/sites/tedexmuskegon/wp-content/themes/some_path/random_file.php:##) in /home/content/##/###########/html/sites/tedexmuskegon/wp-content/themes/some_path/random_file.php on line ##

Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/##/##########/html/sites/tedexmuskegon/wp-content/themes/some_path/random_file.php:##) in /home/content/##/##########/html/sites/some_path/random_file.php on line ##

Note:  In the example above, this –>  /##/##########/  is your GoDaddy number that is displayed in your error.

Whats happening is either your temp folder is not writeable, was never created or is located outside of your “var/home/” directory and there is a server issue preventing you from accessing it.

So here is the fix.
Create a folder in the root of your hosting directory called “temp“.
In the same directory you should see a file called “php5.ini“.
Open that file in a plain text editor. (Not MS Word). Notepad++ on a PC or TextMate on a Mac.
Add these lines to your php5.ini file: (where –>  /##/##########/  is your GoDaddy number that is displayed in your error.)

upload_tmp_dir = /var/chroot/home/content/##/###########/html/temp
session.save_path = /var/chroot/home/content/##/##########/html/temp

Now log into your GoDaddy hosting account and then into your Web Hosting Control Panel.
Find “System Processes” or “PHP Processes” and then click “END ALL“.

Refresh your site and the errors should be gone. This will also store all of your sessions locally in your home directory in a temp folder instead of up a directory outside of your home folder. You can keep an eye on things in this folder if anything ever seems to be going awry. As a side note: This may be fixed with GoDaddys new Ultimate Hosting with CPanel, as the temp directory and everything above the public_html, is exposed to the user for more control of resources.