OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums OroCRM OroCRM – Installation/Technical Issues or Problems PHP Fatal error: Uncaught Error:

This topic contains 13 replies, has 2 voices, and was last updated by Andrey Yatsenko Andrey Yatsenko 3 months, 1 week ago.

  • Creator
    Topic
  • #38762

    Roshan
    Participant

    PHP Fatal error: Uncaught Error: Class ‘ProductsBundle\ProductsBundle’ not found in /usr/share/nginx/orocrm/app/AppKernel.php:13

    CREATING A BUNDLE
    > Generating a sample bundle skeleton into app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/ProductsBundle.php
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Controller/
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Controller/DefaultController.php
    created ./app/../tests/ProductsBundle/Controller/
    created ./app/../tests/ProductsBundle/Controller/DefaultControllerTest.php
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Resources/views/Default/
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Resources/views/Default/index.html.twig
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Resources/config/
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Resources/config/services.yml
    created ./app/../vendor/oro/platform/src/Oro/Bundle/ProductsBundle/Resources/config/routing.yml
    > Checking that the bundle is autoloaded
    > Enabling the bundle inside app/AppKernel.php
    updated ./app/AppKernel.php
    > Importing the bundle’s routes from the app/config/routing.yml file
    updated ./app/config/routing.yml
    > Importing the bundle’s services.yml from the app/config/config.yml file
    updated ./app/config/config.yml

    Everything is OK! Now get to work :).

    when i run php app/console cache:clear
    root:/usr/share/nginx/orocrm# php app/console cache:clear
    PHP Fatal error: Uncaught Error: Class ‘ProductsBundle\ProductsBundle’ not found in /usr/share/nginx/orocrm/app/AppKernel.php:13
    Stack trace:
    #0 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(430): AppKernel->registerBundles()
    #1 /usr/share/nginx/orocrm/vendor/oro/platform/src/Oro/Bundle/DistributionBundle/OroKernel.php(37): Symfony\Component\HttpKernel\Kernel->initializeBundles()
    #2 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(130): Oro\Bundle\DistributionBundle\OroKernel->initializeBundles()
    #3 /usr/share/nginx/orocrm/vendor/oro/platform/src/Oro/Bundle/DistributionBundle/OroKernel.php(228): Symfony\Component\HttpKernel\Kernel->boot()
    #4 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(70): Oro\Bundle\DistributionBundle\OroKernel->boot()
    #5 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(124): Symfony\Bundle\FrameworkBundle\Console\Appl in /usr/share/nginx/orocrm/app/AppKernel.php on line 1

    If i run composer update command
    Problem 1
    – sebastian/phpcpd dev-master requires php ^7.3 -> your PHP version (7.1.28) does not satisfy that requirement.
    – sebastian/phpcpd dev-master requires php ^7.3 -> your PHP version (7.1.28) does not satisfy that requirement.
    – Installation request for sebastian/phpcpd dev-master#cff7f36c2ae89d59987de25d14fd41a72dd4a703 as 3.1.0 -> satisfiable by sebastian/phpcpd[dev-master].

    what is the exact solution for this ??
    and when i enter any other commands like php app/console about and php app/console –version getting the same errors

    • This topic was modified 3 months, 3 weeks ago by  Roshan.
    • This topic was modified 3 months, 3 weeks ago by  Roshan.
    • This topic was modified 3 months, 3 weeks ago by  Roshan.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Author
    Replies
  • #38769
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Please upgrade an application to the latest available 3.1.* release or at least latest 2.6.* release.

    – Installation request for sebastian/phpcpd dev-master#cff7f36c2ae89d59987de25d14fd41a72dd4a703 as 3.1.0 -> satisfiable by sebastian/phpcpd[dev-master].

    This error means you are using the really old version of OroCRM. The issue was fixed in a newer versions.

    According to the “Class not found” exception, make sure the file with the class following PSR-4 in the src folder.

    For more details see:

    #38816

    Roshan
    Participant

    Installed 3.* version after creating a products module getting this error

    created ./public/bundles/ProductsBundle/Resources/config/services.yml
    created ./public/bundles/ProductsBundle/Resources/config/routing.yml
    > Checking that the bundle is autoloaded
    FAILED
    > Enabling the bundle inside src/AppKernel.php
    updated ./src/AppKernel.php
    OK
    > Importing the bundle’s routes from the src/config/routing.yml file

    created ./src/config/
    created ./src/config/routing.yml
    OK
    > Importing the bundle’s services.yml from the src/config/config.yml file
    FAILED

    #38820
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    It is a known issue, the command to create a bundle doesn’t work as expected. Please create the bundle manually by following this guide:
    https://oroinc.com/b2b-ecommerce/doc/current/dev-guide/extend-and-customize/how-to-create-new-bundle

    #38821

    Roshan
    Participant

    in prod mode php bin/console cache:clear -e prod
    working with no errors but in dev mode
    php bin/console cache:clear -e dev
    getting errors

    PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class “ProductsBundle” from namespace “ProductsBundle”.
    Did you forget a “use” statement for another namespace? in /usr/share/nginx/orocrm/src/AppKernel.php:18
    Stack trace:
    #0 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(488): AppKernel->registerBundles()
    #1 /usr/share/nginx/orocrm/vendor/oro/platform/src/Oro/Bundle/DistributionBundle/OroKernel.php(37): Symfony\Component\HttpKernel\Kernel->initializeBundles()
    #2 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(132): Oro\Bundle\DistributionBundle\OroKernel->initializeBundles()
    #3 /usr/share/nginx/orocrm/vendor/oro/platform/src/Oro/Bundle/DistributionBundle/OroKernel.php(228): Symfony\Component\HttpKernel\Kernel->boot()
    #4 /usr/share/nginx/orocrm/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(64): Oro\Bundle\DistributionBundle\OroKernel->boot()
    #5 /usr/shar in /usr/share/nginx/orocrm/src/AppKernel.php on line 18

    when opens URL/app_dev.php getting 404 error
    not found

    #38824
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    The issue is related to the class autoloading. For the “src/” folder PSR-4 standard is used.

    make sure the classes inside the folder follow this standard and you don’t have errors in importing classes with the “use” statement.

    #38838

    Roshan
    Participant

    In orocrm 3.1 version how to open dev mode

    when i open URL/app_dev.php or bin_dev.php getting the error page not found
    so how to open dev mode

    is there any way to check bundle registered or not??

    #38843
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Looks like you have an incomplete configuration for the virtual host.
    Please check Web Server Configuration article for an example.

    #38844

    Roshan
    Participant

    virtual host configuration also configured
    when open index_dev page sghowing this line

    You are not allowed to access this file. Check index_dev.php for more information

    • This reply was modified 3 months, 1 week ago by  Roshan.
    #38845
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    The file name is index_dev.php, not app_dev.php.
    You can find the file at the public/ folder.

    #38876

    Roshan
    Participant

    virtual host configuration also configured
    when open index_dev page showing this line

    You are not allowed to access this file. Check index_dev.php for more information

    #38877
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Dev environment is accessible only at the localhost by default. To allow using dev from the remote web server, you can customize the index_dev.php file source code to add your IP to the whitelist.

    #38878

    Roshan
    Participant

    Already i have changed the IP still getting the same error

    #38879
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Then you did something wrong.
    The exception threw directly by index_dev.php file.
    Please check your changes one more time.

Viewing 13 replies - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No