Answer the question
In order to leave comments, you need to log in
Why does the error 500 occur (everything works without problems on the mirror)?
Hello! There is a site on wordpress that needs to be transferred to another hosting. On the 2nd hosting, a domain with a Cyrillic domain name was created and linked, and the corresponding folder (in Latin) was created. Transferred the site, database, set up the conversion of the domain name using the service. As a result: it lets you into the admin panel, displays the standard theme, but in the created one it causes a 500 error - in the logs:
[24-Nov-2016 07:37:39] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/name/wp-content/themes/themes-name/front-page.php on line 116
[Nov-24-2016 07:38:57] PHP Parse error: syntax error, unexpected '[', expecting ')' in /home/name/wp-content/themes/themes-name/front-page. php on line 116
new WP_Query([
$section_gates = <?php $section_gates = new WP_Query([
'post_type' => 'section_gates',
'name' => 'sektsionnye-vorota',
'post_status' => 'publish',
'posts_per_page'=> -1,
'order' => 'ASC'
]);
while($section_gates->have_posts()):
$section_gates->the_post();
Answer the question
In order to leave comments, you need to log in
Old PHP version on new server. The character [
opens the array in the new PHP, while yours doesn't understand this and expects the old array(
. Update PHP or replace the syntax with the old one and everything will work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question