Error 500 when trying to save blog

  • Hi,

    I am new to Perch and my overall PHP knowledge is a bit rusty so I’m hoping that you can help me, as we have just had a Perch CMS site migrated over to us.

    Everything works fine when going to add a new blog post, but as soon as you click save to add the post it’s throwing a 500 error.

    I have checked and it’s not authentication issues, or files that are not being included so I am not sure what it is that is going wrong.

    I am looking for some guidance on where to start for debugging this error, as a 500 with no message is not really anything useful.

    Thanks, George

  • drewm

    Approved the thread.
  • If you check your server's error log, you should be able to see the error that's being generated when you get the 500 status.

    If not, you could turn on error reporting (presuming this is a dev environment).

  • Hi,

    Thank you for coming back to me.

    below are the errors I have found:

    1. PHP Warning: count(): Parameter must be an array or an object that implements Countable in D:\Websites\\perch\core\lib\PerchFieldTypes.class.php on line 69
    2. PHP Fatal error: Uncaught Error: Call to a member function return_instance() on bool in D:\Websites\\perch\core\lib\api\PerchAPI_Form.class.php:430
    3. Stack trace:
    4. #0 D:\Websites\\perch\addons\apps\perch_blog\modes\edit.pre.php(76): PerchAPI_Form->receive_from_template_fields(Object(PerchAPI_Template), Array)
    5. #1 D:\Websites\\perch\addons\apps\perch_blog\edit\index.php(26): include('D:\\Websites\\xyz...')
    6. #2 {main}
    7. thrown in D:\Websites\\perch\core\lib\api\PerchAPI_Form.class.php on line 430

    Bare in mind that all the code/data was transferred over to us from our clients previous provider.

    Thanks, George