• Resolved Sakthivel

    (@saravanankanagaraj)


    We have recently moved the session related changes like below code,
    then facing the fatal issue on admin dashboard.

    Added the below code in function.php file

    function start_Session(){
    if (!session_id()) {
    session_start();
    }
    }
    add_action(‘init’, ‘start_Session’, 1);`

    https://ibb.co/3FHdsgN

    It’s working when deactivating the wordfence plugin. Please tell me how to fix this issue.

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @saravanankanagaraj, thanks for your question.

    That specific error message comes from a WordPress feature included in WordPress 4.9+. It checks for PHP errors in the built-in file editor to prevent saving code that could/will break your site. However, the same error can be caused if something is preventing the WordPress loopback from executing the script to check your code. It is possible that Wordfence is doing the blocking so again Learning Mode could help.

    From the Wordfence Dashboard click on Manage WAF. Then you will see Basic Firewall Options > Web Application Firewall Status. Change the option to Learning Mode. Now try editing this code again. This will help Wordfence learn that the background actions are normal and it will allow them in the future. After you have finished performing the actions, switch the WAF from Learning Mode back to Enabled and Protecting. Now test to see if these actions work correctly.

    However, if you decide to make code changes such as this by downloading the file via (S)FTP and uploading it back or editing PHP files in your hosting control panel, you shouldn’t experience this error as it’s specific to editing within WordPress.

    Let me know how you get on,

    Peter.

    Thread Starter Sakthivel

    (@saravanankanagaraj)

    Hi @wfpeter ,

    I had tried the above method. woodfence learning mode is not working to fix my problem. Still am getting the same error while updating the PHP file. when I comment the session code, PHP file updating works fine. Is there any other way to fix it?

    Regards,
    Saravanan

    • This reply was modified 3 years, 1 month ago by Sakthivel.
    Plugin Support wfpeter

    (@wfpeter)

    Hi @saravanankanagaraj,

    Please can you send me a diagnostic report from your site so I can take a closer look at your configuration? You can send it to wftest @ wordfence . com from the top of the Wordfence > Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    NOTE: It should look as follows – Screenshot of Tools > Diagnostic > Send by Email

    Thanks,

    Peter.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Facing fatal error while update the php files using wordpress dashboard’ is closed to new replies.