[Nix-dev] [PATCH 1/2] enhance phpIni documentation

Marc Weber marco-oweber at gmx.de
Thu Jan 7 04:06:43 CET 2010


---
 .../services/web-servers/apache-httpd/default.nix  |   49 +++++++++++++++++--
 1 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix
index 91fce4f..bd0172d 100644
--- a/modules/services/web-servers/apache-httpd/default.nix
+++ b/modules/services/web-servers/apache-httpd/default.nix
@@ -464,6 +464,47 @@ in
         '';
       };
 
+      phpIni = mkOption {
+        default = ''
+           ; Needed for PHP's mail() function.
+           sendmail_path = sendmail -t -i
+         '';
+
+        example = ''
+         phpIni =  pkgs.phpIniBuilder.override {
+            appendLines = '''
+             sendmail_path = sendmail -t -i
+             zend_extension="''\${pkgs.phpXdebug}/lib/xdebug.so"
+             zend_extension_ts="''\${pkgs.phpXdebug}/lib/xdebug.so"
+             zend_extension_debug="''\${pkgs.phpXdebug}/lib/xdebug.so"
+             xdebug.remote_enable=true
+             xdebug.remote_host=127.0.0.1
+             xdebug.remote_port=9000
+             xdebug.remote_handler=dbgp
+             xdebug.profiler_enable=0
+             xdebug.profiler_output_dir="/tmp/xdebug"
+             xdebug.remote_mode=req
+            ''';
+          };
+        '';
+
+
+        description = ''
+          The contents of this option are used as global php.ini file by the
+          PHP interpreter used by Apache. You have to enable PHP explicitly.
+          See extraModules options.
+
+          This file defaults to defining sendmail_path only.
+
+          Note: Depending on your configuration you can set PHP ini values using .htaccess files and the
+          php_value option.
+
+          The example shows how to enable Xdebug and use the recommended
+          php.ini values which are contained in the PHP distribution.
+          I don't know whether they are equal to defaults
+        '';
+      };
+
     }
 
     # Include the options shared between the main server and virtual hosts.
@@ -520,12 +561,8 @@ in
                 optional config.networking.defaultMailServer.directDelivery "${pkgs.ssmtp}/sbin"
              ++ (concatMap (svc: svc.extraServerPath) allSubservices) );
 
-           PHPRC = pkgs.writeText "php.ini"
-             ''
-               ; Needed for PHP's mail() function.
-               sendmail_path = sendmail -t -i
-             '';
-           
+           PHPRC = mainCfg.phpIni;
+
           } // (listToAttrs (concatMap (svc: svc.globalEnvVars) allSubservices));
 
         preStart =
-- 
1.6.5.6




More information about the nix-dev mailing list