Laravel 6 Process class relies on proc_open exception - laravel

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,
],

Related

I get Error when upload laravel to host server

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,

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.

spatie/laravel-backup notifications not posting

Using Laravel 5.3 and v4 from spatie/laravel-backup package.
I am using this package from Spatie which allows me to take backups using a simple terminal command. It is pretty straight forward to set up and when I run the command the backup runs as intended.
But there is also an option in the config file to set notifications (send mail, post to slack, ...) after a backup. This does not seem to do anything for me. I neither receive mails (and I have set my mailaddress) or see posts to my dedicated slack channel (and i have added the webhook).
I have already included the following composer packages since researching this problem:
Guzzlehttp/guzzle
maknz/slack-laravel
maknz/slack
This is the simple notifications section in the config file:
'notifications' => [
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'],
],
/*
* Here you can specify the notifiable to which the notifications should be sent. The default
* notifiable will use the variables specified in this config file.
*/
'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,
'mail' => [
'to' => 'nicolas#******.***',
],
'slack' => [
'webhook_url' => 'https://hooks.slack.com/services/*****/*****/*************',
],
],
Not really sure if I am forgetting something? Thanks for the help
The output I get in terminal after running the commands: gist.github
Extra:
This is a talk at Laracon EU 2016, where the creator (Freek) shows off his package.

Resources