vote up 1 vote down star

I had a Drupal installation at www.example.com/test. Now, it's ready to go live, and I am trying to move it to www.example.com. I changed the line in sites/default/settings.php to:

$base_url = 'http://www.example.com/';  // NO trailing slash!

When I navigate to my index.php, I get all sorts of parse errors, like this:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' 
in /home/example/public_html/sites/all/modules/typogrify/typogrify.class.php 
on line 18

The problem is this:

  public static function amp($text) {
    $amp_finder = "/(\s| )(&|&|&\#38;|&)(\s| )/";
    return preg_replace($amp_finder, '\\1<span class="amp">&amp;</span>\\3', $text);
  }

Every function like this is causing errors. then does PHP no longer understand this syntax that worked perfectly fine before in a subdirectory?

flag

75% accept rate
1  
What PHP version do you use? – Gumbo Nov 15 at 20:35
PHP Version 4.4.9 – Rosarch Nov 15 at 21:02
Well then, that's your problem right there. – troelskn Nov 15 at 22:30

2 Answers

vote up 2 vote down check

IIRC, that is the error one got when trying to use visibility declarations (private/protected/public) in PHP 4. Could it be that your live environment uses a different PHP version than your testing environment?

While Drupal 6 core is supposed to still be compatible with PHP 4, many modules are not, as PHP 4 is not maintained anymore and does not get any security fixes since August 2008. Using it for a production site is therefore a big NO security wise.

So before investing any time in 'fixing' this, I'd recommend switching to PHP 5 immediately.

Probably unrelated to your problem, but did you read the comment on the line setting the $base_url variable? You should remove the trailing slash, in case you also have it there with your real URL.


Edit: Just checked the 'Typogrify' class from the offending file. It seems to be just a collection of static methods (functions). So if that is the only file giving you problems, you might be able to work around this by removing all the 'public' declarations in there, as they are not strictly necessary.

Note that I do not recommend this - you should not run a production site with a deprecated, unmaintained PHP version!)

link|flag
vote up 2 vote down
$base_url = 'http://www.example.com/';  // NO trailing slash!

NO trailing slash! ;)

link|flag
WOW. good for me. – Rosarch Nov 15 at 22:45

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.