Jump to:

4938 Posts in 16827 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » /dev/build fails with PHP 5.4

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3072 Views
  • smares
    Avatar
    Community Member
    25 Posts

    /dev/build fails with PHP 5.4 Link to this post

    Can anyone confirm that 2.4.7's /dev/build fails with PHP 5.4. I get a notice "Array to string conversion" and backtrace tells me it's in Line 327 of Database.php: SS_Database->requireIndex(ErrorPage_versions,RecordID_Version,Array)

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: /dev/build fails with PHP 5.4 Link to this post

    I read that php 5.4 no longer silently accepts array to string conversion, the idea being that it should warn against useless casting (or something of that nature)

    I guess silverstripe will work when php warnings are disabled, but this should maybe be patched/looked into if version 2 is to be continued alongside 3? There might be other places where this might happen as well?

  • mrProper
    Avatar
    Community Member
    7 Posts

    Re: /dev/build fails with PHP 5.4 Link to this post

    Hi smares
    I confirm. PHP 5.4.3
    My error is in Line 162 of SSViewer.php

    162       if(substr((string) $templateList,-3) == '.ss') {
    163          $this->chosenTemplates['main'] = $templateList;
    164       } else {
    165          if(!is_array($templateList)) $templateList = array($templateList);
    166          
    167          if(isset($_GET['debug_request'])) Debug::message("Selecting templates from the following list: " . implode(", ", $templateList));


    Do you find a clue?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: /dev/build fails with PHP 5.4 Link to this post

    Simply change

    if(substr((string) $templateList,-3) == '.ss') {

    to

    if(is_string($templateList) && substr((string) $templateList,-3) == '.ss') {

    Though not sure if 2.4 'officially' supports PHP5.4

  • Sean
    Avatar
    Forum Moderator
    921 Posts
  • socks
    Avatar
    Community Member
    190 Posts

    Re: /dev/build fails with PHP 5.4 Link to this post

    Should I be having the same issue with 3.0.2 and PHP 5.3? Just get a blank white page (rest of site shows up fine)

    Not sure if it's related but the installation gives the false mod_rewrite and AllowOverride All issues with Friendly URLs.
    http://open.silverstripe.org/ticket/7498

    Thanks

  • a1abhishek
    Avatar
    Community Member
    1 Post

    Re: /dev/build fails with PHP 5.4 Link to this post

    we have the same problem occurring again n again.

  • socks
    Avatar
    Community Member
    190 Posts

    Re: /dev/build fails with PHP 5.4 Link to this post

    I upgraded from 3.0.2 to the daily build and that fixed the dev/build issues.

    3072 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.