[Nix-dev] Help with setup php xdebug

Guillaume Maudoux (Layus) layus.on at gmail.com
Tue Sep 29 10:25:01 CEST 2015


Dear Erik,

I am no expert on this topic, but it seems to me that writing a custom 
phpIni is the way to go.
For example, I have the following code in my config, which mimics the 
default phpIni generation.

       phpIni = pkgs.runCommand "php.ini"
         {
           options = ''
extension=${pkgs.phpPackages.imagick}/lib/php/extensions/imagick.so
             max_execution_time = 30
             post_max_size = 100M
             upload_max_size = 100M
             upload_max_filesize = 20M
             memory_limit = 256M
           '';
         }
         ''
           cat ${pkgs.php}/etc/php-recommended.ini > $out
           echo "$options" >> $out
         '';

It would not be the NixOS way to allow a newly installed package to 
modify the behaviour of another package.
What if using the new extension suddenly breaks another server ?
In fact, if PHP needs to be modified and rebuilt with php-xdebug as a 
dependency to account for it.
(Of course, PHP could also load all the extensions in 
/var/lib/php/extensions of such, but that is precisely what NixOS tries 
to avoid.)

Still, I agree that the phpIni creation could be turned into an helper 
(maybe pkgs.php.customPhpIni {extraOptions = ''...'';}).

Best regards,
Guillaume.

PS: This is just one instance of a larger problem.
For example, newly installed latex packages are expected to be 
accessible to pdflatex right after their install.
But this means that pdflatex needs to be modified and rebuilt to account 
for the new dependency ;-).


Le 29/09/15 09:52, 4levels a écrit :
> Dear Nix Devs,
>
> I'm somewhat struggling to enable the php-xdebug extension in php.
> I did manage to get the extension installed but the php interpreter 
> itself seems to ignore its existence.
>
> I did find some topics on this and as a workaround I could specify a 
> custom php-ini file but I was wondering if there is no better way.  
> Shouldn't just installing the php-package xdebug also enable it by 
> default?
>
> I'm not using apache but nginx with php-fpm as webserver so the httpd 
> options seem unusable.  I also can't seem to add options to php in the 
> php-fpm pool config, to load the extension and set some xdebug params.
>
> Any advice on how to go about this?  I'd love to see php compiled with 
> xdebug so I can use the phpunit code coverage reports.
>
> So php with xdebug - how to?
>
> Kind regards,
>
> Erik
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list