heroku deploy fail on autoload files generation - heroku

Cannot deploy my symfony v4 app to heroku.
https://dashboard.heroku.com/apps/heroku-roku/deploy/github
https://github.com/rokiszb/symfonyproject
Generating optimized autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "WebServerBundle" from namespace "Symfony\Bundle\WebServerBundle".
!! Did you forget a "use" statement for another namespace? in /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/src/Kernel.php:32
!! Stack trace:
!! #0 /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/vendor/symfony/http-kernel/Kernel.php(403): App\Kernel->registerBundles()
!! #1 /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/vendor/symfony/http-kernel/Kernel.php(122): Symfony\Component\HttpKernel\Kernel->initializeBundles()
!! #2 /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/vendor/symfony/framework-bundle/Console/Application.php(64): Symfony\Component\HttpKernel\Kernel->boot()
!! #3 /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/vendor/symfony/console/Application.php(143): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object in /tmp/build_28117d3324a8922a1e14fe57f3023b59/rokiszb-symfonyproject-da9bd88/src/Kernel.php on line 32
been trying to solve it for many hours, need help

Related

Composer Update with Laravel 5.4 & PHP 7 "Class Name must be a valid object or a string"

So there are a few threads on this but none with exactly the same issue. Basically I upgraded to php 5.4 from 5.1 and php 7 from 5.6 and I am now getting this error message.
PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in /var/www/dev1/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:96
The reason this seems weird to me is the error is in the actual laravel files not in my app / something I have edited. This error happens when I run composer update or whenever I try and visit any of my webpages. Below is a full dump from composer update, any ideas?
[root#dev1 dev1]# composer update
> php artisan clear-compiled
PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in /var/www/dev1/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:96
Stack trace:
#0 [internal function]: Illuminate\Foundation\Exceptions\Handler->Illuminate\Foundation\Exceptions\{closure}(0, 'Symfony\\Compone...')
#1 /var/www/dev1/bootstrap/cache/compiled.php(6207): call_user_func(Object(Closure), 0, 'Symfony\\Compone...')
#2 /var/www/dev1/bootstrap/cache/compiled.php(12223): Illuminate\Support\Arr::first(Array, Object(Closure), NULL)
#3 /var/www/dev1/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(97): Illuminate\Support\Collection->first(Object(Closure))
#4 /var/www/dev1/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(61): Illuminate\Foundation\Exceptions\Handler->shouldntReport(Object(ReflectionException))
#5 /var/www/dev1/app/Exceptions/Handler.php(33): Illuminate\Foundation\Exceptions\Handler->report(Object(ReflectionException))
#6 /var/www/dev1/vendor/laravel/fram in /var/www/dev1/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php on line 96
Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255
I've got a similar error when upgrading to Laravel 5.4. The problem is that Laravel is still loading bootstrap/cache/compiled.php (even though it says it's not used by the framework anymore). Removing the file will solve your issue.
From the docs:
If it exists, you may delete the bootstrap/cache/compiled.php file. It is no longer used by the framework.
php artisan cache:clear
php artisan clear-compiled
sudo composer dump-autoload

Enable PHPUnit with Laravel / Homestead on PhpStorm 2016.1 to

I am working on vagrant / homestead, and have a box configured.
I could enable Xdebug in PhpStorm!
Now, I want to enable PHPUnit, but I can't do it...
I followed several tutorials:
https://blog.mayflower.de/5274-Run-your-tests-with-PHPStorm-on-your-vagrant-box.html
https://confluence.jetbrains.com/display/PhpStorm/Running+PHPUnit+tests+over+SSH+on+a+remote+server+with+PhpStorm
Here are my settings:
Here is the message I receive when running PhpUnit with Code Coverage
vagrant:///Users/julien/Homestead/usr/bin/php -dxdebug.coverage_enable=1 /home/vagrant/.phpstorm_helpers/phpunit.php --coverage-clover /home/vagrant/.phpstorm_helpers/coverage/Laravel_PhpUnit.coverage -- configuration /home/vagrant/Code/vendor/autoload.php /Users/julien/Documents/Proyectos/laravel/tests/functional
Testing started at 11:12 AM ...
bash: line 0: cd: /Users/julien/Documents/Proyectos/laravel/tests/functional: No such file or directory
PHP Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php:181
Stack trace:
Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181#0 /home/vagrant/.phpstorm_helpers/phpunit.php(181): Phar- >__construct('/home/vagrant/C...')
#1 /home/vagrant/.phpstorm_helpers/phpunit.php(250): IDE_PHPUnit_Loader::init()
#2 {main}
UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181
thrown in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181
Call Stack:
0.0006 442920 1. {main}() /home/vagrant/.phpstorm_helpers/phpunit.php:0
0.0006 442920 2. IDE_PHPUnit_Loader::init() /home/vagrant/.phpstorm_helpers/phpunit.php:250
0.0006 451168 3. Phar->__construct() /home/vagrant/.phpstorm_helpers/phpunit.php:181
Process finished with exit code 255
Setting up vagrant with PhpStorm and PHPUnit can be a little bit daunting as it is really not that straight forward... From your console output I'd say that your interpreter setting is not correct since it executes PHP on your local machine.
The way that always worked for me was setting up vagrant as SFTP Deployment Configuration and use that configuration as PHP interpreter. As you are already using Homesteasd, these tutorials might shed some more light onto the setup:
Setting up PhpStorm with Vagrant on a Laravel Homestead box
Setting up Laravel with PHPUnit on Vagrant in PhpStorm
Here are the essential parts:

cloning laravel project (non-compound name 'App')

I'm clonning my laravel project from my repo, then I run composer install and then composer update. But I'm getting an error:
php artisan clear-compiled
[ErrorException] The
use statement with non-compound name 'App' has no effect
Script php artisan clear-compiled handling the pre-update-cmd event
returned with an error
[RuntimeException] Error Output:
I can't figure out why is this happening and google couldn't help me this time. This is the log, what more disturbs me is that I can composer update from another machine in which I pushed the firsts commits.
[2015-12-15 18:41:42] local.ERROR: exception 'ErrorException' with
message 'The use statement with non-compound name 'App' has no effect'
in /var/www/html/anuncios.com/app/Http/routes.php:3 Stack trace:
0 /var/www/html/anuncios.com/app/Providers/RouteServiceProvider.php(41):
Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'The
use stateme...', '/var/www/html/a...', 3, Array)
1 /var/www/html/anuncios.com/app/Providers/RouteServiceProvider.php(41):
App\Providers\RouteServiceProvider::App\Providers{closure}()
...

Magento2 - Setup Compile Error - Class Not_Existing_Class does not exist

I installed magento 2 Community version successfully. Now when i try to upgrade the setup i get the error Please re-run Magento compile command.
So i ran the compile command
magento setup:di:compile
but i am getting this error
Area configuration aggregation... 5/7 [====================>-------] 71% 35 min
s 736.2 MiB
[ReflectionException]
Class Not_Existing_Class does not exist
[ReflectionException]
Class Not_Existing_Class does not exist
Any ideas as to how this can be resolved ?!
Thanks in advance.
As a temporary fix, i was able to resolve this problem by commenting following line:
\Not_Existing_Class $notExistingClass
in << Magento2 Root Folder >>\vendor\magento\framework\Code\Test\Unit\Generator\TestAsset\TestGenerationClass.php
I have also reported the issue on GitHub here and awaiting the community's response: https://github.com/magento/magento2/issues/2404

Debugging a Laravel 5 artisan migrate unexpected T_VARIABLE FatalErrorException

When running artisan migrate on a Laravel 5 project, it is failing with the following FatalErrorException:
$ artisan migrate -vvv --force
[Symfony\Component\Debug\Exception\FatalErrorException] syntax
error, unexpected '$table' (T_VARIABLE)
How do I get the file and line that is causing the error?
If in anyway relevant, I'm on a Windows 7 x64 machine with WAMP - PHP 5.6 and Laravel Framework version 5.1.10 (LTS).
There might be a semicolon or bracket missing a line
Check all in your migration files.
Laravel is configured to create daily log files for your application
which are stored in the storage/logs directory.
http://laravel.com/docs/5.1/errors#logging
This class Symfony\Component\Debug\Exception\FatalErrorException has some differences compared with the other Exception classes and it is not properly presented by the "error renderers" or "error notifiers".
A New sentry "error notifier" ("getsentry/sentry-php" version >= "2.0") will give you a proper stack trace.
Here is issue where is reported : https://github.com/getsentry/sentry-php/issues/761
Here is the PR for fix : https://github.com/getsentry/sentry-php/pull/763

Resources