D
D
Denis99992018-03-16 15:34:50
WordPress
Denis9999, 2018-03-16 15:34:50

Why is there a 500 error on a Wordpress site?

A very strange reaction to the error occurred. The reason was the following:

$postarr = array(
      'post_type' => 'fotootchet',
      'post_title'    => $row['name'],
      'post_status'   => 'publish'
      'post_content' => $attach_arr_str
    );

Missing comma after 'post_status' => 'publish' . Why was this error not displayed as a normal one - the server responded with a 500 code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Yanchevsky, 2018-03-16
@deniscopro

It is likely that error reporting is disabled on the server.
You can, for example, enable WP_DEBUG in config.php , then you will see the reason for the error.

F
freeman0204, 2018-03-16
@freeman0204

Perhaps you are using <?= ?> instead of <?php ?>

P
Pychev Anatoly, 2018-03-17
@pton

If the code must collect the response to the ajax request, then it will throw a server error. How else to notify?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question