Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

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

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

Blank screen after migration, devmode shows error


Go to End


6 Posts   2659 Views

Avatar
LinseyM

Community Member, 99 Posts

9 March 2010 at 8:37pm

Hi there,

Just migrated a site to a new server and having problems.

Uploaded the db and all files, set permissions etc and was just getting blank white screen with no output. (done this before on other server setups with no problem!)

Can't run a clean isntall either.

Put site into devmode and get following error:

[Warning] Wrong parameter count for substr_count()
GET /admin

Line 304 in /home/brandc/public_html/test/sapphire/core/control/HTTPRequest.php
Source

295
296 // Special case for the root URL controller
297 if(!$pattern) {
298 return ($this->dirParts == array()) ? array('Matched' => true) : false;
299 }
300
301 // Check for the '//' marker that represents the "shifting point"
302 $doubleSlashPoint = strpos($pattern, '//');
303 if($doubleSlashPoint !== false) {
304 $shiftCount = substr_count($pattern, '/', 0, $doubleSlashPoint) + 1;
305 $pattern = str_replace('//', '/', $pattern);
306 $patternParts = explode('/', $pattern);
307
308
309 } else {
310 $patternParts = explode('/', $pattern);

Trace

* substr_count(admin/security//$Action/$ID/$OtherID,/,0,14)
Line 304 of HTTPRequest.php
* HTTPRequest->match(admin/security//$Action/$ID/$OtherID,1)
Line 244 of Director.php
* Director::handleRequest(Object id #8,Session)
Line 121 of Director.php
* Director::direct(/admin)
Line 118 of main.php

Any suggestions? I can see from the php.ini that the PHP version is 5.0.4 - is this really likely to be what is causing the error? Cannot rebuild database, so unsure what to do.

When I uploaded the origianl .htaccess and _config.php and tried to do a clean install in a blank db it tried to install but just sat at install.php and couldn't get passed it.

Avatar
LinseyM

Community Member, 99 Posts

9 March 2010 at 8:44pm

Don't know that it makes any difference, but I've got the TwitterWidgetPack and UserForms add-ons uploaded.

Avatar
Sean

Forum Moderator, 922 Posts

9 March 2010 at 9:20pm

Edited: 09/03/2010 9:26pm

PHP 5.0.4 is very old. This is most definitely the cause of the problem. Is there any way you can use _at least_ 5.1? 5.2 is highly recommended, as PHP was terrible before this version! You might want to ask your host nicely to upgrade, as 5.0.4 is ridiculously old!

EDIT: Confirmed. http://php.net/substr_count reports 2 additional arguments were added to this function in PHP 5.1.0. Any version before this only accepted two.

If you _really_ need it to work, you could try adding @ to the start of substr_count() to ignore the warning and the execution should continue. I can't guarantee the site will still operate correctly, however.

Sean

Avatar
LinseyM

Community Member, 99 Posts

9 March 2010 at 9:25pm

Hi Sean,

Thanks very much for the swift reply. I'll pass this information to the hosting company and ask them to put it on a server with 5.2

I'll get back and update the post on how this goes.

Appreciated.

Linsey :)

Avatar
Sean

Forum Moderator, 922 Posts

9 March 2010 at 9:28pm

Let them know PHP 5.2.13 is the latest in the 5.2.x line. :-)

Avatar
LinseyM

Community Member, 99 Posts

11 March 2010 at 2:36pm

Well that fixed it! Job done.

Many thanks.

(",)