I am working on a project using Silex. In a specific file, I added a use statement so that the autoloader includes a specific php file. Later in the file I use this class. Everything is fine on the development server, but when I switch to production, I get the message Fatal error: Class not found . Edit: PHP 5.4.4 is now used on both servers.
Are there any installation problems that might be causing this? I can confirm that both autoload namespace files created by the composer are the same.
Just for the sake of thoroughness, here is the include statement:
use Instaphp;
Here is the use of the class later in the code:
$app['instaphp'] = $app->share(function() use ($app) { if($app['tagframe.instagram_token'] === null) { return Instaphp\Instaphp::Instance(); } else { return Instaphp\Instaphp::Instance($app['tagframe.instagram_token']); } }); $app['instaphp.config'] = $app->share(function() use ($app) { return Instaphp\Config::Instance(); });
Here is the exact error:
Fatal error: Class 'Instaphp\Config' not found in /var/www/silexsandbox/src/TagFrame/Silex/TagFrameServiceProvider.php on line 89
Update: I have to add that I have not seen such errors anywhere in a rather large code base that I am working on, so I know that it is not as simple as all namespaces do not work.
source share