Syntax error in yaml.php file when uploading to server

Hi there,

I’ve used Kirby in a fair amount of websites, all running on our same server without a hitch. Today, I’ve finished a new project, but whilst uploading and using the website, I get a weird PHP-error on the page as well as on the Panel. I’ve tried re-uploading as I thought something has gone wonky during upload, but this wasn’t the case.

My development server resembles our production server as closely as possible, so I’m not really sure what’s going on. Website is running on PHP 5.6 with Apache running as the web server. No caching or something else turned on at this point.

I have no idea what’s going on, does maybe someone else have a clue?

Parse error: syntax error, unexpected '$array' (T_VARIABLE) in /var/www/vhosts/esoes.eu/httpdocs/kirby/toolkit/vendors/yaml/yaml.php on line 634

Does this happen on the whole site or only on a particular page? Do you use any plugins?

I’ve uploaded the website to the following domain, so you can take a look. http://esoes.eu/

I’m not using any plugins as far as I know. The error occurs when loading the panel, and happens on the main page when it tries to loads the first piece of content generated with a structure-field. Funny thing is, I’m using the toStructure() method instead of yaml().

Could you post your blueprint and template code for the structure field?

Sure.

Blueprint

introslider:
    label: Onze foodtruck - Slider
    type: structure
    entry: >
        {{foto}}
    fields:
        foto:
            label: Afbeelding
            type: image

Template

        <div class="gallery">
            <?php $homepage = page('home'->url() ?>
            <?php foreach($page->introslider()->toStructure() as $introslider): ?>
            <div class="gallery-cell">
                <figure style="background-image:url(<?php echo $homepage.'/home/'; ?><?php echo $introslider->foto() ?>)"></figure>
            </div>
            <?php endforeach ?>
        </div>

Don’t know if this is just a copy error, but there’s a closing parenthesis missing, should be:

<?php $homepage = page('home')->url() ?>

Unfortunately, a copy error. :neutral_face:

I’ve been looking over the docs, has it something to do with the fact that my empty Kirby starter template is based on a development version? I have been using this for a few weeks without any problems. Also the reason why there is the image-field in blueprints.

Hm, the error you get looks like the file kirby/toolkit/vendors/yaml/yaml.php is invalid.
Could you please download a fresh copy from GitHub? Also, please verify again that your server uses PHP 5.6.