Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checker for php.ini options #71

Open
akalongman opened this issue Jan 17, 2019 · 8 comments
Open

Checker for php.ini options #71

akalongman opened this issue Jan 17, 2019 · 8 comments

Comments

@akalongman
Copy link

For my project I've implemented checker for php.ini options. Configuration looks like this:

\App\Libraries\SelfDiagnosis\Checks\PhpIniOptions::class                  => [
    'options' => [
        'upload_max_filesize' => '>=128M',
        'post_max_size'       => '>=128M',
        'memory_limit'        => '>=128M',
        'max_input_vars'      => '>=10000',
        'file_uploads'        => '1',
        'disable_functions'   => '',
    ],
],

If project owners will be interested, I can send PR

@akalongman
Copy link
Author

@mpociot any thoughts?

@HDVinnie
Copy link

I would like to see this added.

@alexsoft
Copy link

There can be an issue of checking it, as the command will be run in cli, and for requests, fpm is used. But probably it is feasible, just less obvious to implement 🤷‍♂️

@akalongman
Copy link
Author

There can be an issue of checking it, as the command will be run in cli

I run it in HTTP via $kernel->call() from controller

@sarfraznawaz2005
Copy link

@akalongman Can you please tell how are you using $kernel->call(). I cannot figure out how I use that with ini_get('max_execution_time') for example.

@akalongman
Copy link
Author

akalongman commented Jul 26, 2019

@sarfraznawaz2005 You have to run

$output = new BufferedOutput(
    OutputInterface::VERBOSITY_NORMAL,
    true,
);

$kernel->call('self-diagnosis', [], $output)

($kernel is Illuminate\Contracts\Console\Kernel)

@sarfraznawaz2005
Copy link

sarfraznawaz2005 commented Jul 26, 2019

@akalongman Thanks. As @alexsoft pointed out we should use http kernel instead of console kernel to get correct php ini value which is expected on web (http). So not sure how I can I get value for ini_get('max_execution_time') which comes from php.ini used for web not for console (a different php.ini file is used by server for cli).

@sarfraznawaz2005
Copy link

sarfraznawaz2005 commented Jul 27, 2019

@akalongman okay so this can return php.ini flags used for web/http: $values = parse_ini_file(php_ini_loaded_file());

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants