vendredi 15 juin 2018

Laravel use custom php.ini with artisan serve

Is there a way to pass a custom php.ini to artisan serve?

I've tried

php -c path/to/my/custom/php.ini artisan serve

This does not seem to affect the web server though?

I know where my .ini files are, and I know how to edit them. I just can't seem to make artisan serve use a custom .ini.

I also looked at:

php artisan serve --help 

and it didn't seem to list any options for setting the .ini.

My reason is that I have a customize .ini file with XDebug enabled. I want to be able to use it when debugging my Laravel app, but I don't want it enabled in my default php.ini

UPDATE

I've looked in

vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php

for Laravel 5.6.25 at lines 49-57 and they have this:

 /**
 * Get the full server command.
 *
 * @return string
 */
protected function serverCommand()
{
    return sprintf('%s -S %s:%s %s',
        ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)),
        $this->host(),
        $this->port(),
        ProcessUtils::escapeArgument(base_path('server.php'))
    );
}

So it looks like it is not possible to pass in a custom .ini unless the PhpExecutableFinder would include the -c argument for the .ini path?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire