New install, CoursePress causes header errors

Hi guys,

Just set up a new e-learning site and am installing a few WPMU Dev-only plugins - Signup TOS, Support System and CoursePress Pro. When I install CoursePress I get a load of errors at the top and bottom of all pages and "’" instead of apostrophes. I am also getting permission errors when I try to do other things (like activating the CoursePress theme).

I'm guessing there is a server setting I need to change, but not sure which. I had trouble with my personal site which eventually brought the whole site down, so want to sort this out before I go further!

Have you any ideas what could be causing this? I am on my own dedicated server running WHM/cPanel and PHP 5.4.38.

Thanks!
Arthur

    Arthur

    Here are the errors:

    pen(/tmp/sess_e6bb37d543cac545e147dc7dd95e0663, O_RDWR) failed: Permission denied (13) in /home/acgtrain/public_html/wp-content/plugins/coursepress/coursepress.php on line 153

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/acgtrain/public_html/wp-content/plugins/coursepress/coursepress.php:153) in /home/acgtrain/public_html/wp-content/plugins/coursepress/coursepress.php on line 153

    Warning: Cannot modify header information - headers already sent by (output started at /home/acgtrain/public_html/wp-content/plugins/coursepress/coursepress.php:153) in /home/acgtrain/public_html/wp-includes/option.php on line 772

    Warning: Cannot modify header information - headers already sent by (output started at /home/acgtrain/public_html/wp-content/plugins/coursepress/coursepress.php:153) in /home/acgtrain/public_html/wp-includes/option.php on line 773

    And at the bottom:

    /tmp/sess_e6bb37d543cac545e147dc7dd95e0663, O_RDWR) failed: Permission denied (13) 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

    Adam Czajczyk

    Hey Arthur,

    I hope you're well today and thank you for your question!

    First, please deactivate (if you managed to activate it) the CoursePress and - preferably - all other plugins.

    The most important part here seems to be this part:

    /tmp/sess_e6bb37d543cac545e147dc7dd95e0663, O_RDWR) failed: Permission denied (13) 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

    This clearly states that your WP install doesn't have permission to write into the /tmp (temporary data) folder. That being said, you need to login to your server's root console (via SSH) and change the /tmp folder permissions.

    Locate the /tmp folder on your server (most likely it's in the root directory) and if your sever's running under Linux, issue this commands:

    chmod -R go-rwx /tmp/* /tmp/.[!.]*
    chmod 777 /tmp/.X11-unix /tmp/.X11-unix/*
    chmod 1777 /tmp

    Depending on a distribution you're using, you might have to modify it slightly, like this:

    sudo chmod... etc.

    If you don't feel like playing with your server's filesystem settings, you may want to ask your hosting provider to change /tmp permissions for you.

    Let me know if it worked!

    Cheers,
    Adam

    Arthur

    Hi Adam

    Thanks for the reply! I do have some experience with server admin, but I also have cPanel, so have adjusted the permissions in file manager

    That seems to have worked, after restarting the browser (actually I also restarted apache just in case..!)

    I'm wondering if the error was actually caused by my changing the IP address of the site in WHM, which has not worked properly as it redirects to the shared IP, for some reason. But since I had problems with CoursePress before I naturally blamed this...????

    Anyway, thanks for the tip. I'm a bit nervous about leaving the permissions completely open like that - I might try 775...

    Cheers,
    Arthur

    Adam Czajczyk

    Hey Arthur,

    I hope you're well!

    I'm glad to know that my tip helped!

    I'm wondering if the error was actually caused by my changing the IP address of the site in WHM,

    As they say - everything's possible However, I'd rather bet on some changes in server's configuration or PHP configuration. I suppose there might have been for example a PHP update or reconfiguration and php session_path setting has changed.

    As for "open permissions" - you've got a point! 777 isn't a safe configuration, however the /tmp directory (or some other, if you decide to change session path setting for php) has to be writable at some level (preferably web server and most likely its group). That said, sure try setting it to 775 and see what happens. Then gradually go lower until the error appears again. This way you'll find the tightest working access level for this directory.

    I hope that helps and if you have any further questions, I'll be happy to assist!

    Cheers,
    Adam