3

I'm getting the following error only on production, the production env uses PHP 5.5.17 and my dev env uses 5.5.30 so I don't think that is an issue, dev env is Ubuntu and I think prod is Windows. I'm not much of a PHP guy so any help is welcomed.

PHP Fatal error: Class 'Handlebars\\Handlebars' not found

require get_template_directory() .'/handlebars/Autoloader.php';
Handlebars\Autoloader::register();
use Handlebars\Handlebars;
$handlebars = new Handlebars(handlebars_settings());
Stefan
  • 2,961
  • 1
  • 22
  • 34
  • You seem to be mixing upper and lower case. – Burki Dec 14 '15 at 15:48
  • @Burki where, the first line is the file path that is lowercase - the rest are class names that are uppercase. – Stefan Dec 14 '15 at 15:58
  • Windows is case sensitive. You might try to change the directory to `Handlebars` and see if that works. That's just an educated guess, though. – Burki Dec 14 '15 at 16:01
  • @Burki Windows is a non case sensitive environment, and neither is PHP when comes to function names. – Brian Leishman Dec 14 '15 at 16:05
  • @BrianLeishman i stand corrected. Typically it is case insensitive. But as the second answer to [this](http://stackoverflow.com/questions/7199039/file-paths-in-windows-environment-case-sensitive) suggests, you can still get in trouble. – Burki Dec 14 '15 at 16:10
  • It doesn't seem to be a case issue, I did just notice that the path is very strange any thoughts, in particular the /http.apache/ here is the full path I edited it a bit to hide the client - /http.apache/stage.mysite.com/html/wp-content/themes/theme_name/index.php – Stefan Dec 14 '15 at 17:17

1 Answers1

0

The issue was the case of the folder path /handlebars/ for some reason OS X & CentOS 7 were able to translate the path in PHP which was /Handlebars/ to lowercase, the Windows Server 2003 was not able to.

Stefan
  • 2,961
  • 1
  • 22
  • 34