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.

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