Jump to:

557 Posts in 3305 Topics by 244 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » ReflectionClass errors when using SS 2.4.7 on PHP5.4.2

What you need to consider when choosing a hosting provider and plan.

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

Page: 1 2
Go to End
Author Topic: 3555 Views
  • vwd
    Avatar
    Community Member
    158 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    RE: the array to string conversion errors, this patch might be useful. Not too nice having to patch bits and pieces to get things working but might be necessary especially when it's not viable to upgrade to SS3.0 and in a shared host situation where the PHP version is dictated to you.

    VWD.

  • vwd
    Avatar
    Community Member
    158 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    What's really strange about the errors I get on our dev server (running PHP 5.4.4) is that the errors (Notice] Array to string conversion) only show up when testing with Opera browsers (Mobile/Desktop). All other browsers (Safari, IE, Chrome, Firefox) seem to be OK.

    I wonder what the Opera browsers are doing to invoke these errors?

    VWD.

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    Hi there,

    I updated my Linux Box to Ubuntu 12.10 yesterday, which is running on PHP 5.4.6.

    Now I'm running into the same Problems.

    I tried a fresh Installation of SS 2.4.7 and 2.4.8 and both are running into the "string conversion error" within the installscript and showing up the "Uncaught ReflectionException" when trying to enter the Backend.

    Anyone any new Idea, what needs to be fixed and how it can be fixed?

  • Van
    Avatar
    Administrator
    25 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    Are you sure your Reflection package is installed?

    This link might be useful: https://groups.google.com/forum/?fromgroups=#!topic/bloggerdev/ykYZEJBz0lI

    Hope that helps.

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    Hi there,

    I'm sure, that I have my Reflection Package installed.

    Asking phpinfo on a Ubuntu 12.04 (with PHP 5.3.10) and 12.10 (with PHP 5.4.6) both times is showing me "Reflection enabled".

    Again, here is the exact error that ist shown:

    [User Error] Uncaught ReflectionException: Access to non-public constructor of class Transliterator
    GET /~andre/ss248/dev/build?returnURL=%2F%7Eandre%2Fss248%2F

    Line 90 in /home/andre/public_html/ss248/sapphire/core/Object.php

    Source

    81     * @param mixed $arguments,... arguments to pass to the constructor
    82     * @return Object
    83     */
    84    public static function create() {
    85       $args = func_get_args();
    86       $class = self::getCustomClass(array_shift($args));
    87       
    88       if(version_compare(PHP_VERSION, '5.1.3', '>=')) {
    89          $reflector = new ReflectionClass($class);
    90          return $reflector->newInstanceArgs($args);
    91       } else {
    92          // we're using a PHP install that doesn't support ReflectionClass->newInstanceArgs()
    93          
    94          $args = $args + array_fill(0, 9, null);
    95          return new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]);
    96       }
    Trace

    ReflectionClass->newInstanceArgs(Array)
    Line 90 of Object.php
    Object::create(Transliterator)
    Line 1520 of SiteTree.php
    SiteTree->generateURLSegment(About Us)
    Line 1352 of SiteTree.php
    SiteTree->onBeforeWrite()
    Line 936 of DataObject.php
    DataObject->write()
    Line 1309 of SiteTree.php
    SiteTree->requireDefaultRecords()
    Line 235 of DatabaseAdmin.php
    DatabaseAdmin->doBuild(1)
    Line 99 of DatabaseAdmin.php
    DatabaseAdmin->build(SS_HTTPRequest)
    Line 193 of Controller.php
    Controller->handleAction(SS_HTTPRequest)
    Line 143 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 134 of DevelopmentAdmin.php
    DevelopmentAdmin->build(SS_HTTPRequest)
    Line 143 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 282 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session)
    Line 125 of Director.php
    Director::direct(/dev/build)
    Line 127 of main.php

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    Don't know why that helped with my ReflectionException Problem, but here is one solution:

    I deinstalled php5-apc and installed php5-xcache.

    Now the reflection error is gone.

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    I'm sorry, for everyone with the same error, hoping for a solution.

    Nothing changed after apc to xcache switch. I was testing on the wrong installation.

    So still the ReflectionExeption exists.

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: ReflectionClass errors when using SS 2.4.7 on PHP5.4.2 Link to this post

    This problem occurs because PHP 5.4 with the Intl extension from PECL includes a Transliterator class that conflicts with the one include with SilverStripe. There's a patch you can apply here, or you can remove the intl extension if you're not using it.

    3555 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.