L
L
ligisayan2016-11-24 10:18:54
PHP
ligisayan, 2016-11-24 10:18:54

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

in this place - line 116<?php $section_gates = new WP_Query([
<?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();

On the Latin mirror, everything works without problems and errors. What is the reason, how to find and fix the error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Vorotnev, 2016-11-24
@ligisayan

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 question

Ask a Question

731 491 924 answers to any question