Search code examples
symfonybundles

PHP Fatal error: Class 'Stfalcon\Bundle\TinymceBundle\StfalconTinymceBundle' not found


I'm trying to install the Stfalcon TinyMCE editor bundle onto my Symfony 3 project. I have a local install, and then an installation on the server. On my local, I used composer require to pull down the bundle, registered the bundle in AppKernel.php and then ran the following command:

php bin/console assets:install web/

And my result:

Installing assets as hard copies.

 --- ----------------------- ---------------- 
      Bundle                  Method / Error  
 --- ----------------------- ---------------- 
  ✔   StfalconTinymceBundle   copy            
 --- ----------------------- ---------------- 

 ! [NOTE] Some assets were installed via copy. If you make changes to these assets you have to run this command     
 !        again.                                                                                                                                                                                                            
 [OK] All assets were successfully installed.

I added the configuration to my config.yml file, ran it absolutely fine. However, when I installed it on the live server, it went OK when I used composer require, but after I registered the bundle and ran the assets:install command, I received the following error:

PHP Fatal error:  Class 'Stfalcon\Bundle\TinymceBundle\StfalconTinymceBundle' not found in /var/www/vhosts/mocms.co.uk/httpdocs/app/AppKernel.php on line 22

I don't understand, as the bundle is definitely there within the vendor folder, the installation is an exact copy of the local, as I have been using version control.

Does anyone have an idea as to why this would happen on a live server and not the local? The site itself is working, it's the right PHP version and every other command seems to work. Any help appreciated.


Solution

  • Take a look at your /vendor/composer/autoload_psr4.php or autoload_namespaces.phpfile you will have all the namespace association array for your app.

    Just search for tinymce.

    This will show you the namespace that was declared to the autoload and to what actual directory it corresponds:

    'Stfalcon\\Bundle\\TinymceBundle' => array($vendorDir . '/stfalcon/tinymce-bundle'),