Saltstack Official PHP Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
10KB

  1. {% set php = salt['pillar.get']('php:ng', {
  2. 'lookup': salt['grains.filter_by']({
  3. 'Debian': {
  4. 'pkgs': {
  5. 'php': 'php5',
  6. 'apc': 'php-apc',
  7. 'cgi': 'php5-cgi',
  8. 'cli': 'php5-cli',
  9. 'curl': 'php5-curl',
  10. 'fpm': 'php5-fpm',
  11. 'gd': 'php5-gd',
  12. 'intl': 'php5-intl',
  13. 'mbstring': 'php5',
  14. 'mcrypt': 'php5-mcrypt',
  15. 'memcache': 'php5-memcache',
  16. 'memcached': 'php5-memcached',
  17. 'mysql': 'php5-mysql',
  18. 'mysqlnd': 'php5-mysqlnd',
  19. 'pear': 'php-pear',
  20. 'soap': 'php-soap',
  21. 'xml': 'php5-xmlrpc',
  22. 'redis': 'php5-redis',
  23. 'imagick': 'php5-imagick',
  24. 'suhosin': 'php5-suhosin',
  25. 'imap': 'php5-imap',
  26. 'adodb': 'php5-adodb',
  27. 'pgsql': 'php5-pgsql',
  28. 'ldap': 'php5-ldap',
  29. 'json': 'php5-json',
  30. },
  31. 'fpm': {
  32. 'conf': '/etc/php5/fpm/php-fpm.conf',
  33. 'ini': '/etc/php5/fpm/php.ini',
  34. 'pools': '/etc/php5/fpm/pool.d',
  35. 'service': 'php5-fpm',
  36. 'defaults': odict([
  37. ('global', odict([
  38. ('pid', '/var/run/php5-fpm.pid'),
  39. ('error_log', '/var/log/php5-fpm.log'),
  40. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  41. ])),
  42. ]),
  43. },
  44. 'cli': {
  45. 'ini': '/etc/php5/cli/php.ini',
  46. },
  47. },
  48. 'RedHat': {
  49. 'pkgs': {
  50. 'php': 'php',
  51. 'apc': 'php-pecl-apc',
  52. 'cgi': 'php-cgi',
  53. 'cli': 'php-cli',
  54. 'curl': ['php-common', 'curl'],
  55. 'fpm': 'php-fpm',
  56. 'gd': 'php-gd',
  57. 'intl': 'php-intl',
  58. 'mbstring': 'php-mbstring',
  59. 'mcrypt': 'php-mcrypt',
  60. 'memcache': 'php-pecl-memcache',
  61. 'memcached': 'php-pecl-memcached',
  62. 'mysql': 'php-mysql',
  63. 'mysqlnd': 'php-mysqlnd',
  64. 'pear': 'php-pear',
  65. 'soap': 'php-soap',
  66. 'xml': 'php-xml',
  67. 'redis': 'php-redis',
  68. 'imagick': 'php-imagick',
  69. 'suhosin': 'php-suhosin',
  70. 'imap': 'php-imap',
  71. 'adodb': 'php-adodb',
  72. 'pgsql': 'php-pgsql',
  73. 'ldap': 'php-ldap',
  74. 'json': 'php-common',
  75. },
  76. 'fpm': {
  77. 'conf': '/etc/php-fpm.conf',
  78. 'ini': '/etc/php.ini',
  79. 'pools': '/etc/php-fpm.d',
  80. 'service': 'php-fpm',
  81. 'defaults': {
  82. 'global': {
  83. 'pid': '/var/run/php-fpm/php-fpm.pid',
  84. 'error_log': '/var/log/php-fpm/error.log',
  85. 'include': '/etc/php-fpm.d/*.conf',
  86. },
  87. },
  88. },
  89. 'cli': {
  90. 'ini': '/etc/php.ini',
  91. },
  92. },
  93. }),
  94. 'fpm': {
  95. 'service': {
  96. 'enabled': True,
  97. 'opts': {},
  98. },
  99. 'config': {
  100. 'ini': {
  101. 'opts': {},
  102. 'settings': {},
  103. },
  104. 'conf': {
  105. 'opts': {},
  106. 'settings': {},
  107. },
  108. },
  109. 'pools': {},
  110. },
  111. 'cli': {
  112. 'ini': {
  113. 'opts': {},
  114. 'settings': {},
  115. }
  116. },
  117. 'ini': {
  118. 'defaults': {
  119. 'PHP': {
  120. 'engine': 'On',
  121. 'short_open_tag': 'Off',
  122. 'asp_tags': 'Off',
  123. 'precision': 14,
  124. 'output_buffering': 4096,
  125. 'zlib.output_compression': 'Off',
  126. 'implicit_flush': 'Off',
  127. 'serialize_precision': 17,
  128. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  129. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  130. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  131. 'zend.enable_gc': 'On',
  132. 'expose_php': 'On',
  133. 'max_execution_time': 30,
  134. 'max_input_time': 60,
  135. 'max_input_nesting_level': 64,
  136. 'max_input_vars': 1000,
  137. 'memory_limit': '128M',
  138. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  139. 'display_errors': 'Off',
  140. 'display_startup_errors': 'Off',
  141. 'log_errors': 'On',
  142. 'log_errors_max_len': 1024,
  143. 'ignore_repeated_errors': 'Off',
  144. 'ignore_repeated_source': 'Off',
  145. 'report_memleaks': 'On',
  146. 'track_errors': 'Off',
  147. 'html_errors': 'On',
  148. 'variables_order': 'GPCS',
  149. 'request_order': 'GP',
  150. 'register_argc_argv': 'Off',
  151. 'auto_globals_jit': 'On',
  152. 'post_max_size': '8M',
  153. 'default_mimetype': '"text/html"',
  154. 'enable_dl': 'Off',
  155. 'file_uploads': 'On',
  156. 'upload_max_filesize': '2M',
  157. 'max_file_uploads': 20,
  158. 'allow_url_fopen': 'On',
  159. 'allow_url_include': 'Off',
  160. 'default_socket_timeout': 60
  161. },
  162. 'CLI Server': {
  163. 'cli_server.color': 'On'
  164. },
  165. 'Date': {
  166. 'date.timezone': 'America/New_York'
  167. },
  168. 'Pdo_mysql': {
  169. 'pdo_mysql.cache_size': 2000
  170. },
  171. 'mail function': {
  172. 'SMTP': 'localhost',
  173. 'mail.add_x_header': 'On'
  174. },
  175. 'SQL': {
  176. 'sql.safe_mode': 'Off'
  177. },
  178. 'ODBC': {
  179. 'odbc.allow_persistent': 'On',
  180. 'odbc.check_persistent': 'On',
  181. 'odbc.max_persistent': '-1',
  182. 'odbc.max_links': '-1',
  183. 'odbc.defaultlrl': 4096,
  184. 'odbc.defaultbinmode': 1
  185. },
  186. 'Interbase': {
  187. 'ibase.allow_persistent': 1,
  188. 'ibase.max_persistent': -1,
  189. 'ibase.max_links': -1,
  190. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  191. 'ibase.dateformat': '"%Y-%m-%d"',
  192. 'ibase.timeformat': '"%H:%M:%S"'
  193. },
  194. 'MySQL': {
  195. 'mysql.allow_local_infile': 'On',
  196. 'mysql.allow_persistent': 'On',
  197. 'mysql.cache_size': '2000',
  198. 'mysql.max_persistent': -1,
  199. 'mysql.max_links': -1,
  200. 'mysql.connect_timeout': 60,
  201. 'mysql.trace_mode': 'Off'
  202. },
  203. 'MySQLi': {
  204. 'mysqli.max_persistent': -1,
  205. 'mysqli.allow_persistent': 'On',
  206. 'mysqli.max_links': -1,
  207. 'mysqli.cache_size': 2000,
  208. 'mysqli.default_port': 3306,
  209. 'mysqli.reconnect': 'Off'
  210. },
  211. 'mysqlnd': {
  212. 'mysqlnd.collect_statistics': 'On',
  213. 'mysqlnd.collect_memory_statistics': 'Off'
  214. },
  215. 'PostgreSQL': {
  216. 'pgsql.allow_persistent': 'On',
  217. 'pgsql.auto_reset_persistent': 'Off',
  218. 'pgsql.max_persistent': -1,
  219. 'pgsql.max_links': -1,
  220. 'pgsql.ignore_notice': 0,
  221. 'pgsql.log_notice': 0
  222. },
  223. 'Sybase-CT': {
  224. 'sybct.allow_persistent': 'On',
  225. 'sybct.max_persistent': -1,
  226. 'sybct.max_links': -1,
  227. 'sybct.min_server_severity': 10,
  228. 'sybct.min_client_severity': 10
  229. },
  230. 'bcmath': {
  231. 'bcmath.scale': 0
  232. },
  233. 'Session': {
  234. 'session.save_handler': 'files',
  235. 'session.use_strict_mode': 0,
  236. 'session.use_cookies': 1,
  237. 'session.use_only_cookies': 1,
  238. 'session.name': 'PHPSESSID',
  239. 'session.auto_start': 0,
  240. 'session.cookie_lifetime': 0,
  241. 'session.cookie_path': '/',
  242. 'session.serialize_handler': 'php',
  243. 'session.gc_probability': 0,
  244. 'session.gc_divisor': 1000,
  245. 'session.gc_maxlifetime': 1440,
  246. 'session.bug_compat_42': 'Off',
  247. 'session.bug_compat_warn': 'Off',
  248. 'session.cache_limiter': 'nocache',
  249. 'session.cache_expire': '180',
  250. 'session.use_trans_sid': 0,
  251. 'session.hash_function': 0,
  252. 'session.hash_bits_per_character': 5,
  253. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  254. },
  255. 'MSSQL': {
  256. 'mssql.allow_persistent': 'On',
  257. 'mssql.max_persistent': -1,
  258. 'mssql.max_links': -1,
  259. 'mssql.min_error_severity': 10,
  260. 'mssql.min_message_severity': 10,
  261. 'mssql.compatibility_mode': 'Off',
  262. 'mssql.secure_connection': 'Off'
  263. },
  264. 'Tidy': {
  265. 'tidy.clean_output': 'Off'
  266. },
  267. 'soap': {
  268. 'soap.wsdl_cache_enabled': 1,
  269. 'soap.wsdl_cache_dir': '"/tmp"',
  270. 'soap.wsdl_cache_ttl': 86400,
  271. 'soap.wsdl_cache_limit': 5
  272. },
  273. 'ldap': {
  274. 'ldap.max_links': -1
  275. },
  276. },
  277. },
  278. }, merge=True) %}