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.

277 lines
9.9KB

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