I get Error when upload laravel to host server - laravel

I was getting this error after upload project to the host server
"The Process class relies on proc_open, which is not available on your
PHP installation"
then after seeking the solution it disappear then this appear I don't know how to fixed it
"Action Facade\Ignition\Http\Controllers\ExecuteSolutionController not
defined"

In your server console run :
php artisan optimize
That way you clear your routes/cache
This will solve the issue you are mentioning

I got this error on laravel 6
solotion is
php artisan vendor:publish --tag=flare-config
and in config/flare.php Update
'reporting' => [
'anonymize_ips' => true,
'collect_git_information' => false,
'report_queries' => true,
'maximum_number_of_collected_queries' => 200,
'report_query_bindings' => true,
'report_view_data' => true,
],
'send_logs_as_events' => false,

Related

Laravel 6 Process class relies on proc_open exception

Laravel Version: 6
PHP Version: 7.3
Description:
After installing Laravel 6, i get the following error message:
The Process class relies on proc_open, which is not available on your PHP installation.
I don't have find anything in the docs about this?
It is because of Flare error reporting service enabled in debug mode
There is a workaround for this.
Publish flare config file
php artisan vendor:publish --tag=flare-config
and in config/flare.php
Set
'collect_git_information' => false
'reporting' => [
'anonymize_ips' => true,
'collect_git_information' => false,
'report_queries' => true,
'maximum_number_of_collected_queries' => 200,
'report_query_bindings' => true,
'report_view_data' => true,
],

Laravel forge Redis setup Undefined index: queue on RedisConnector

I am running Laravel 5.7 on Forge. Things are working well. I have two simple jobs that run. One when a user logs in and one when users want to download a large file.
In my local they both work great. Once deployed on forge they both fail with the same exception:
ErrorException: Undefined index: queue in /home/forge/SITE/vendor/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php:46
The stack trace points right back to the two lines where I call dispatch();
My setup is default for Redis. I have not changed my env or anything else related to a normal redis setup.
Both my local and my prod forge site have:
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
I have no idea why this would happen only in my Forge setup. TIA
--
After continueing to look into this, when I run it locally I have run php artisan queue:work
I tested running this after ssh'ing into my forge server and got this:
ErrorException : Undefined index: queue
at /home/forge/members.spaceangels.com/vendor/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php:46
42| */
43| public function connect(array $config)
44| {
45| return new RedisQueue(
46| $this->redis, $config['queue'],
47| $config['connection'] ?? $this->connection,
48| $config['retry_after'] ?? 60,
49| $config['block_for'] ?? null
50| );
Exception trace:
1 Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Undefined index: queue", "/home/forge/members.spaceangels.com/vendor/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php", [])
/home/forge/members.spaceangels.com/vendor/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php:46
2 Illuminate\Queue\Connectors\RedisConnector::connect(["redis"])
/home/forge/members.spaceangels.com/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:157
Please use the argument -v to see more details.
my config/queue.php setting:
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'retry_after' => 90,
'block_for' => null,
],
I feel like this is something missing between my config and how forge enables Redis
Well, it seems like your .env file is missing:
CACHE_DRIVER=redis

Laravel php artisan produces error

I have integrated and working in a Laravel 5.4 project. I was actually configure this correctly and php artisan command was working perfectly before.But in between the development time(I have implemented the schedule task using laravel and not sure after that issue appear) it produces m error on php artisan commands. Can anybody help me on this.
The following is the error log for the command for any artisan command
PHP Fatal error: Uncaught
Symfony\Component\Debug\Exception\FatalThrowableError: Type error:
Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct()
must be an instance of Illuminate\Http\Request, null given, called in
/var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php
on line 60 in
/var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:103
Stack trace:
#0 /var/www/html/projrct/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php(60):
Illuminate\Routing\UrlGenerator->__construct(Object(Illuminate\Routing\RouteCollection),
NULL)
#1 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(290):
Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing{closure}(Object(Illuminate\Foundation\Application))
#2 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(746):
Illuminate\Container\Container->Illuminate\Container{closur in
/var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php
on line 103
Please make sure that you are not using any url() or asset() or other helpers functions inside your configuration files
I my case url() helper function in my filesystem.php is causing the issue. I removed it and every thing works fine.
Another alternative solution to commenting out the url() and asset() calls could be to check the environment at run time:
return [
'URL' => app()->runningInConsole() ? '' : url(''),
...
];
If Really Need The Function To Be Inside Your Config, You Could use PHP_SAPI
To Check Weather The App Is Running HTTP or CLI,
'redirect' => PHP_SAPI === 'cli' ? false : url('synchronise')
I figured out the problem, when you are running any artisan command you should avoid using helper functions in any of your config files. Just comment those and try to run artisan command after running that uncomment your config files.
//in config/'any_file.php'
return [
'name' => 'Larvel',
'url' => url('/')
];
//just change and uncomment url() helper
return [
'name' => 'Larvel',
//'url' => url('/')
];
Well I got stuck at same issue while I was using asset in config file (adminlte.php) of Admin LTE.
Please comment your asset, url while using artisan command in config files like this
[
'type' => 'js',
'asset' => false,
// 'location' => asset('js/waitme/waitMe.min.js'),
],

Hybridauth + composer: how to add custom providers

I'm converting a php project to use composer as dependency manager.
The dependencies are loaded via this line in my main script.
require 'vendor/autoload.php';
One of these dependencies is hybridauth (version 2.9). Since using Composer, it throws 'file not found' errors when looking for custom providers files.
For instance, my main controller calls Hybrid like this:
$config_file_path = dirname(__FILE__) .'/hybridauth/config.php';
$hybridauth = new Hybrid_Auth( $config_file_path );
Now, here is the config file. The provider i'm using is "Facebooktest".
Note that I had to specify the path via the [wrapper][path]; array key to get to the next error message.
return
array(
"base_url" => WWWROOT."/auth",
"providers" => array(
"Facebook" => array(
"enabled" => true,
"keys" => array("id" => "xxxxxxx", "secret" => "xxxxxxxx"),
"scope" => "email",
"trustForwarded" => false
),
"Facebooktest" => array(
"enabled" => true,
"keys" => array("id" => "xxxxxxx", "secret" => "xxxxxx"),
"scope" => "email",
"trustForwarded" => false,
"wrapper"=> array(
"class"=>'Hybrid_Providers_Facebooktest',
"path"=> './controllers/hybridauth/Hybrid/Providers/Facebooktest.php'
)
)
),
"debug_mode" => false,
"debug_file" => "",
);
The error message (with trace):
require_once(/path/to/composer-project/vendor/hybridauth/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/autoload.php): failed to open stream: No such file or directory
[vendor/bcosca/fatfree/lib/base.php:2174] Base->error()
[controllers/hybridauth/Hybrid/Providers/Facebooktest.php:61] Base->{closure}()
[controllers/hybridauth/Hybrid/Providers/Facebooktest.php:61] require_once()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Model.php:99] Hybrid_Providers_Facebooktest->initialize()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Adapter.php:101] Hybrid_Provider_Model->__construct()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Auth.php:278] Hybrid_Provider_Adapter->factory()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Auth.php:230] Hybrid_Auth::setup()
[controllers/auth-action.get.php:19] Hybrid_Auth::authenticate()
I find it strange that I now need to modify paths inside the "vendor/hybridauth/" project. It defeats the purpose of using a dependency manager. Surely, I must be doing it wrong.
Can you advise?
Check my answer to another question here
If you have recently installed Hybridauth through composer you probably have downloaded v2.9.2, which contain a bug in their Facebook class that replace the vendor path from yours to hybridauth/vendor, causing such issue.
I suspect you created that Facebooktest class by copying their Facebook class and therefore sustained that error. Either update to their dev branch and copy that Facebook class, or simply use other provider class as template for your custom provider class.

Laravel config/app.php not updating

in laravel 5 , config/app.php I've set the locale to 'ar'
but while trying to get locale in code via:
config('app.locale');
I still get 'en'.
Seems like config/app.php isn't auto-loaded/updated.
even if config/app.php is empty, executingconfig('app'); returns:
array:10 [▼
"debug" => true
"url" => "http://localhost"
"timezone" => "UTC"
"locale" => "en"
"fallback_locale" => "en"
"key" => "XXXXXXXXXXXXXXXXXXXXXXX" // changed here
"cipher" => "AES-256-CBC"
"log" => "single"
"providers" => array:31 [▶]
"aliases" => array:36 [▶]]
Some hint will be appreciated.
Seems like configuration settings were cached. use php artisan config:clear
Just a minor additional note to this. If you are running a local server on localhost:8000 with php artisan serve and you make changes to either your .env file or in config files, even after clearing the config cache with the steps in the accepted answer, it doesn't update.
You need to stop the local server (control + c in Terminal) and run php artisan serve to start it again - then your changes get picked up.

Resources