Heroku Symfony 3.2 Push rejected, failed to compile PHP app - php

I'm having trouble while deploying my symfony web app on heroku, when previously it worked just fine. What could be wrong?
This is the build log: http://pastebin.com/DXZH110S
Here is the relevant part of the log:
Generating optimized autoload files
Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle".
Did you forget a "use" statement for another namespace? in /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/app/AppKernel.php:25
Stack trace:
#0 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(403): AppKernel->registerBundles()
#1 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(113): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/Console/Appli in /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/app/AppKernel.php on line 25
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle".
Did you forget a "use" statement for another namespace? in /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/app/AppKernel.php:25
Stack trace:
#0 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(403): AppKernel->registerBundles()
#1 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(113): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/vendor/symfony/symfony/src/Symfony/Component/Console/Appli in /tmp/build_d39105bc4146e68631d1261a1ca2a632/izio7-YourTeam-15b2d72/app/AppKernel.php on line 25

Finally I solved, the problem was the system variable SYMFONY_ENV=prod not set.
https://devcenter.heroku.com/articles/getting-started-with-symfony#configuring-symfony-to-run-in-the-prod-environment

Related

how can I start laravel artisan serve

I am using Laravel and trying to start a PHP artisan server but I get the following error:
PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Users\Admin\Budget\bootstrap\app.php:14
Stack trace:
#0 C:\Users\Admin\Budget\artisan(20): require_once()
#1 {main}
thrown in C:\Users\Admin\Budget\bootstrap\app.php on line 14
How can I fix this?

cannot execute php artisan command [php fatal error[

I have a laravel project I installed the composer
and run
composer install
After that I executed the update command
composer update
on the project's root directory, and during the execution on the command
php artisan optimize
I got the error shown in the attached image.
When I try to execute any php artisan command I got the same error too.
Error lines
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\Auth::check() in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:221
Stack trace:
#0 C:\xampp\htdocs\projectx\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('check', Array)
#1 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(81): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 {main}
thrown in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 221
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\Auth::check() in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:221
Stack trace:
#0 C:\xampp\htdocs\projectx\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('check', Array)
#1 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(81): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#2 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(123): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#3 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#4 {main}
thrown in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 221
You could try to use the append_config() helper method in your environment app configuration file:
'providers' => append_config(array(
'LocalOnlyServiceProvider',
))
The command php artisan optimize has been remove in laravel 5.6
see more: https://laravel.com/docs/5.6/upgrade

Symfony2 Class not found error in AppKernel

I have an exiting project in Symfony running on windows. Now I moved it to my laptop which runs Ubuntu 16.04. But when I try to do app/console it says that class was not found in AppKernel.
Here is the actual error message.
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "PimSecurityBundle" from namespace "Pim\SecurityBundle".
Did you forget a "use" statement for another namespace? in /var/www/html/pim/app/AppKernel.php:34
Stack trace:
0 /var/www/html/pim/app/bootstrap.php.cache(2675): AppKernel->registerBundles()
1 /var/www/html/pim/app/bootstrap.php.cache(2497): Symfony\Component\HttpKernel\Kernel->initializeBundles()
2 /var/www/html/pim/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(70): Symfony\Component\HttpKernel\Kernel->boot()
3 /var/www/html/pim/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(123): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
4 /var/www/html/pim/app/console(27): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
5 {m in /var/www/html/pim/app/AppKernel.php on line 34
I already run composer update several times, remove my vendor and update but nothing works.

Developing PHPUnit: how to run its tests

I want to play around with changing PHPUnit's source, but first I'd like to be able to run its tests to make sure I don't break anything.
I used git to get version 4.7.7 out into a directory. In that directory, I then ran composer install.
Then I cd into tests and run:
phpunit --bootstrap ./bootstrap.php ./
(The version of PHPUnit I'm using to run the tests is also 4.7.7.)
but I get this:
PHP Fatal error: Uncaught exception 'Exception' with message 'PHPUnit suppresses exceptions thrown outside of test case function' in C:\Users\jodes\Documents\NetBeansProjects\PHPUnit\phpunit\tests\Regression\GitHub\873\Issue873Test.php:7
Stack trace:
#0 phar://C:/phpbin/phpunit.phar/phpunit/Util/Fileloader.php(52): include_once()
#1 phar://C:/phpbin/phpunit.phar/phpunit/Util/Fileloader.php(36): PHPUnit_Util_Fileloader::load('C:\Users\jody\D...')
#2 phar://C:/phpbin/phpunit.phar/phpunit/Framework/TestSuite.php(334): PHPUnit_Util_Fileloader::checkAndLoad('C:\Users\jody\D...')
#3 phar://C:/phpbin/phpunit.phar/phpunit/Framework/TestSuite.php(406): PHPUnit_Framework_TestSuite->addTestFile('C:\Users\jody\D...')
#4 phar://C:/phpbin/phpunit.phar/phpunit/Runner/BaseTestRunner.php(57): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#5 phar://C:/phpbin/phpunit.phar/phpunit/TextUI/Command.php(121): PHPUnit_Runner_BaseTestRunner->getTest('.\tests\', '', Array)
#6 phar://C:/phpbin/phpunit.phar/phpunit/TextUI/Command.php(99): PHPUnit_TextU in C:\Users\jody\Documents\NetBeansProjects\PHPUnit\phpunit\tests\Regression\GitHub\873\Issue873Test.php on line 7
Fatal error: Uncaught exception 'Exception' with message 'PHPUnit suppresses exceptions thrown outside of test case function' in C:\Users\jodes\Documents\NetBeansProjects\PHPUnit\phpunit\tests\Regression\GitHub\873\Issue873Test.php:7
Stack trace:
#0 phar://C:/phpbin/phpunit.phar/phpunit/Util/Fileloader.php(52): include_once()
#1 phar://C:/phpbin/phpunit.phar/phpunit/Util/Fileloader.php(36): PHPUnit_Util_Fileloader::load('C:\Users\jody\D...')
#2 phar://C:/phpbin/phpunit.phar/phpunit/Framework/TestSuite.php(334): PHPUnit_Util_Fileloader::checkAndLoad('C:\Users\jody\D...')
#3 phar://C:/phpbin/phpunit.phar/phpunit/Framework/TestSuite.php(406): PHPUnit_Framework_TestSuite->addTestFile('C:\Users\jody\D...')
#4 phar://C:/phpbin/phpunit.phar/phpunit/Runner/BaseTestRunner.php(57): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#5 phar://C:/phpbin/phpunit.phar/phpunit/TextUI/Command.php(121): PHPUnit_Runner_BaseTestRunner->getTest('.\tests\', '', Array)
#6 phar://C:/phpbin/phpunit.phar/phpunit/TextUI/Command.php(99): PHPUnit_TextU in C:\Users\jody\Documents\NetBeansProjects\PHPUnit\phpunit\tests\Regression\GitHub\873\Issue873Test.php on line 7
What am I doing wrong? Thanks
If your class "Success" have a namespace, you better use your autoloader with phpunit's --bootstrap parameter
if this situation is related with autoloading, you maybe want to read http://jes.st/2011/phpunit-bootstrap-and-autoloading-classes/ (an old one, but a clear one)

Apigility - How to use Doctrine ORM Module from ZF2 command line

Hi i'm new with Apigility. Im trying to configure doctrine-orm-module. When i tried to run the command below and getting this error
$ cd /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin
$ php doctrine-module.php
Error is:
PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529
Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529
I followed the installation guide on DoctrineORMModule's readme.md
You don't need to run doctrine-module cli directly inside the bin folder. DoctrineModule already binds related console routes to the application if it's configured correctly.
Try this:
$ cd /var/www/apigility/zf-apigility-skeleton
$ php public/index.php orm:info
Hope it helps.

Categories