Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Still No Word on How to Solve Installation Issue

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 5127 Views
  • wifiman
    Avatar
    Community Member
    20 Posts

    Still No Word on How to Solve Installation Issue Link to this post

    Hi everyone. I am jealous. There's lots of discussion here about how SilverStripe is such a great tool -- and I can't wait to try it out. But it's been about a week now since I tried to install it onto my site (at hosting provider Omnis.com) and I've had nothing but the same problem.

    I've put in extra echo commands through the chain of calls to see exactly where the installation stops. I find that I can get as far as :

    $conn = new $dbClass($databaseConfig);

    in the function connect() in the file sapphire/core/model/DB.php. Apparently that's when the error occurs:

    Fatal error: Class MySQLQuery cannot extend from interface Query in /mywebserver/www/silverstripe/sapphire/core/model/MySQLDatabase.php on line 452

    I am not a knowledgeable enough in PHP/MySQL to tell how to debug this issue further. But it looks like something basic is very very wrong. Thoughts? I keep hearing about a way to engage debugging withing SilverStripe, but I don't know how to do so.

    Some other info:

    * My _config.php file is present in the mysite folder with all of the correct information in it.
    * I checked with Omnis and mod_rewrite should work fine.
    * I am not sure what my .htaccess file should contain; I've tried replacing it a file using a bunch of rewrite directives from other posts on this site. Didn't make a difference whatsoever.

    There's at least one other person who has mentioned an issue with Omnis, but there wasn't a resolution on that thread:

    http://www.silverstripe.com/site-builders-forum/flat/56613?showPost=162574#post56613

    Could someone please let me know what I am doing wrong so that I can be one of the cool kids and actually get my site running with SS?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    This sounds like there is something seriously funky with their php config. Could you post a full phpinfo()?

    I'm wondering if you're missing an extension that the rest of us are taking for granted. I don't know enough about it to comment, but perhaps someone with more knowledge might to be able to help. Eg, class Query implements Iterator, maybe the interface Iterator is not defined?

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    Thanks in advance for any help that you can provide.

    Here is the output from phpinfo() as well as the information from the installation page that comes up during installation of SilverStripe.

    What's the next step?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    Had a look around - this is almost certainly a bug with your PHP installation.

    If you google "cannot extend from interface" you get a few pages or errors that are appearing on other sites, but I can't find anything about what specifically would be causing it. You've got a fairly recent gentoo php build - maybe it's a genuine php bug?

    Put the following code into a php file you can run an post the output. At least it will tell us if some basic stuff is working.

    <?php
    abstract class TestAbstractClass implements Iterator {

    }

    class TestClass extends TestAbstractClass {

       public function current() {
       
       }
       
       public function next() {
       
       }
       
       public function key() {
       
       }
       
       public function valid() {
       
       }
       
       public function rewind() {
       
       }

    }

    class TestClassExtended extends TestClass {

    }

    echo "Creating a new test class... ";
    $test = new TestClass();
    echo "Done<br>";

    echo "<b>Class information</b><br>";
    echo "Test Class is a ".get_class($test);
    echo " implementing ";

    $implements = "";
    foreach(class_implements($test) as $implement){
       $implements.= $implements ? " and " : "";
       $implements.=$implement;
    }
    echo $implements;

    echo "<br><br>";

    echo "Creating a new extended test class... ";
    $testExtended = new TestClassExtended();
    echo "Done<br>";

    echo "<b>Class information</b><br>";
    echo "Test Class is a ".get_class($testExtended);
    echo " implementing ";

    $implements = "";
    foreach(class_implements($testExtended) as $implement){
       $implements.= $implements ? " and " : "";
       $implements.=$implement;
    }
    echo $implements;

    ?>

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    OK took the code and ran it on my site. Looks like it worked, but I am not sure:

    Creating a new test class... Done
    Class information
    Test Class is a TestClass implementing Traversable and Iterator

    Creating a new extended test class... Done
    Class information
    Test Class is a TestClassExtended implementing Iterator and Traversable

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    Found it!

    You have a PHP extension "onPHP" that contains an interface called Query. Unforunately, Query is supposed to be an abstract class defined by SilverStripe, but the onPHP interface is getting in the way.

    A couple of options:

    1. get your host to disable onPHP

    2. modify your SilverStripe installation. It's not so difficult - modify the word "Query" in line 398 of MySQLDatabase.php and line 483 of Database.php (both found in sapphire/core/model) to a name of your choice (eg "SS_Query"). I've tested it and it works fine.

    To the devs - this might be an ongoing problem. Might it be time to prefix the most generic class names with something suitable?

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    Thanks so much for the effort in helping me get past that issue. How did you figure out the class name collision? I'd like to learn what you did so that I can find items like this in the future.

    Unfortunately, I am not out of the woods yet. Now I am getting the infamous mod_write test problem:

    mod_rewrite doesn't appear to be working. Make sure:

    * mod_rewrite is enabled in your httpd.conf
    * AllowOverride is enabled for the current path.

    I will check again with Omnis.com, but they told me that mod_rewrite will work. I've seen some posts about editing httpd.conf, but I don't see how that's possible in a hosted environment (my www root is virtual for my account). I hope that this doesn't mean I am stuck. Let me know if you've seen similar problems. Again many thanks for your continued help, I do appreciate it!

  • mandrew
    Avatar
    Core Development Team
    32 Posts

    Re: Still No Word on How to Solve Installation Issue Link to this post

    Hi Hamish, are you able to create a ticket for the onPHP issue at http://open.silverstripe.com/ and include your findings with the ticket and we will try and add a patch in trunk or at least think about how best to resolve this for the next version.

    5127 Views
Page: 1 2
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.