laravel artisan app:name resulted in syntax errors - php

I am using Laravel 5 on a shared host. I have installed it ok. However on running:
/usr/bin/php55-cli artisan app:name 247
the laravel install broke. I tracked it down to app.php and the new name caused syntax errors. I got it working again by using Linux to do a global replace changing it back from 247 to App.
Does anyone know why? And how can I get artisan to work properly?
Thanks

This is not Laravel nor artisan issue, but plain PHP syntax error.
PHP does not allow variable or class name to start with an integer. Same goes to namespaces. So your error comes from you app name being 247. First letter can not be an integer.

Related

Call to undefined method Illuminate\Routing\RouteFileRegistrar::get() - Error after upgrading from Laravel 5.7 to 5.8

I have a running app written on Laravel 5.7. I tried to change the record in composer.json to match "5.8.*" and ran composer update. On my local (win10/WAMP) machine it went fine, but on the staging server (Debian 9/nginx) the update command changed the vendor contents and failed at the end.
Since then anything I do with the app on the server I get this error and I can't find any information anywhere.
Call to undefined method Illuminate\Routing\RouteFileRegistrar::get()
And this is the line that fails:
$this->get('login', 'Auth\LoginController#showLoginForm')->name('login');
Thanks in advance!
remove "$this" from your routes and use "Route::"
It is a problem with the routes. Mainly, you get this problem when you are using routes with resource or resources. Make sure you do not have any problem in routes by using the command:
#php artisan route:list
If you are getting any problem while route listing please fix it.
I solved this problem in Laravel 5.8 by fixing routes.
Hope this will help.

After Renamimg app name getting FatalThrowableError

I am using laravel-5.3. After renaming the app when I'm trying to start the server I'm getting the following error
[Symfony\Component\Debug\Exception\FatalThrowableError] Class
'App\Providers\AppServiceProvider' not found
What should i do? I am new at Laravel.
This is probably because you have your configuration cached. You can solve it with the artisan command 'config:cache':
php artisan config:cache
Before this, make sure that you have the correct namespaces in your application.

Moved my laravel 5.3 project from a server to other and I got a lot of issues

I just moved my app from a AWS EC2 server to another.
I deploy with GitHub, so, everything should be smooth.
a
But I got a lot of issues:
When I try to login with user / Pass, I get:
TokenMismatchException in VerifyCsrfToken.php line 68:
When I try to login with socialite ( Google / FB ) I get:
Socialite: InvalidStateException in AbstractProvider.php Line 200
I manage a plugin https://github.com/proengsoft/laravel-jsvalidation, that I also give error
Off course, in local, everything works fine ( I use Laravel valet )
I can't figure out what is the common point between all those elements.
What I did :
composer install
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artian vendor:publish
composer clear-compiled
php artisan migrate -seed
gulp
copied my old .env to the new server ( it's not automatically deployed )
I also checked my storage/framework/sessions folder had write permission.
EDIT: My guess is there is a problem with sessions, but don't really know what... CRSF Field works with session. Also AbstractProvider issue appears to be a session problem. I tried to change session from file to DB, but with no result.
Any idea why is there so many errors?
I read a lot of cases, but none got my solution.
I solved it changing
APP_ENV=testing
to
APP_ENV=test
in my .env file
One more solution to this problem, hope it helps!
Stupid, but very time consuming!!!

laravel - Move app to another server, blank page and artisan error

I need to move app in laravel from web server to local sever (I trying on XAMPP). I moved all files, database and in files I changed URI in:
/index.php
<? header("Location: http://localhost/public"); ?>
but I get errors in:
On http://localhost/ I have blank page
On http://localhost/public and every another route I getting error: http://pastebin.com/zUFqS8ET
When I use php artisan or another commands I getting error:
[ErrorException]
Undefined index: HTTP_USER_AGENT
I forgot about somethink?
EDIT:
Ok, I downgrade my PHP to 5.6.* but artisan still not working - same error, what's the problem?
EDIT 2:
Here is logs - problem is in SMF but I don't know why ...
http://pastebin.com/HZQ7CZeg
Sorry, I know this is obvious. But, have you run PHP composer install? And as a basic test you can create an empty laravel project to test your computer's configuration. If it works then you know its something in your project you need to update.
Laravel installation

Laravel 4 Commands stopped working suddenly

Back from vacation, and when I'm trying to run one of my previously working command:
php artisan list
Throws me:
[root#api2]# php artisan list
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to a member function getArgument() on a non-object","file":"\/var\/www\/html\/api2.alariscms.com\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php","line":153}}
And I seriously cannot understand why this happens. I tried debugging the file that throws an error. It awaits argument:
InputInterface $input but it gets NULL
I don't know what can go wrong on a framework level to stop receiving the required object.
Any ideas where to start debugging from? Or I can reload configurations / update laravel via cmd?
Thanks
This is what I would do:
php artisan dump
composer dump-autoload
check for current Laravel version
and then go to that specific command and check for bug there.
Also, what kind of argument are you trying to pass to command ? Is that object - if so check where is implementation of that class ?

Categories