Custom PHP form not working when WP Super Cache is active (5 posts)

  1. Harish Chouhan
    Posted 5 years ago #

    Am having a wordpress 3.0 network setup with a contact us page which uses a template with a custom PHP form I had developed.

    The form has a session_start(); at the start along with a captcha.

    The form worked properly until I activated WP Super Cache. Any help would be greatly appreciated.

    The error message I get is:
    Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 627 is not allowed to access /tmp owned by uid 0 in /home/site_name/public_html/wp-content/themes/theme_name/contact.php on line 8

    Fatal error: session_start() [function.session-start]: Failed to initialize storage module: files (path: ) in /home/site_name/public_html/wp-content/themes/theme_name/contact.php on line 8

  2. Ron Rennick
    MultiSite Guru
    Posted 5 years ago #

    Add a check to see if the session is already active before calling session_start().

  3. Harish Chouhan
    Posted 5 years ago #

    I tried it, but nothing same error. When I remove my session code it just showed a blank page.

    It worked fine but stopped after I activate WP Super Cache.

  4. Donncha O Caoimh
    Posted 5 years ago #

    Do you have safe mode on?

  5. Harish Chouhan
    Posted 5 years ago #

    Hello Donncha,

    Actually this is weird. On the same server I use the script for many other wordpress sites and it works.

    It worked even on the website that is now showing errors. Since it started after I installed Super Cache plugin, I removed it completely and its working now.

    My PHP safe mode is off.

    To debug I placed the phpinfo() to check the session.save_path value and it was showing "no value".

    The sadest/happiest part is, the issue has fixed by itself. No more errors. Not sure how that happened. I just removed WP Super Cache, and then the site started working and then I installed the plugin back.

    Guess this issue is now solved.

    Thanks Ron & Donncha

Topic Closed

This topic has been closed to new replies.

About this Topic