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

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}()
...

Related

heroku deploy fail on autoload files generation

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

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

php artisan migrate error in Laravel 5.3

I'm trying to create migration table in my particular path
php artisan make:migration create_options_table --create=site_options --path='Nitseditor/Nitseditor/Database'
I'm getting an error
[ErrorException]
Array to string conversion
My directory structure:
Help me out in this.
Well, it is always hard to have just Exception without knowing what file should I check and which line.
First check logs tail storage/logs/laravel.log -n 100 to get a trace of an exception thrown. There you will find the key to solve your problem. Example:
[2017-02-03 22:44:53] local.ERROR: exception 'ErrorException' with message
<message> in <path>:<line>
Stack trace: ...<details>

Blank white page when finished uploading files to server laravel5

I have finished uploading files to server inside demo folder, but when i visited i got blank white page. when i visited somedomain.com/demo i got blank white page. Can anyone help me please. My folder directory start with demo. Inside demofolder i have app,bootstrap,config etc folders.
when i view storage/log file i got
[2015-09-20 06:38:00] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}
[2015-09-20 06:52:16] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}
[2015-09-20 06:53:23] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}
[2015-09-20 06:58:28] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}
The blank page suggests a 500 error and your logs back this up.
Looking at your logs it is an issue with the vendor/compiled.php file.
Just delete this file, run composer update, and then php artisan optimize after the update to rebuild compiled.php.
On a side note, the URL to view this should be somedomain.com/demo/public as this is where the index.php file is located - unless you have already dealt to this.
When you move Laravel 5 to a production server please do the following:
Change permissions of storage and bootstrap folders to 0755 or 0777 chmod -R 0777 storage/
composer install
composer update
artisan cache:clear
This will resolve your dependencies and make laravel functional.
When you get packages conflicts after doing the above steps remove the packages from app/config/app.php and delete their folders from vendor and run composer update.
Also make sure you will meet Laravel 5 minimum requirements. PHP 5.5.9 is required.

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