Saltstack Official PHP Formula
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

2271 行
108KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=jinja
  3. {%- if salt['grains.get']('os') == "Ubuntu" %}
  4. {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %}
  5. {%- if use_external_repo %}
  6. {%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
  7. {%- if salt['grains.get']('osrelease')|string >= '16.04' %}
  8. {%- set php = salt['pillar.get']('php:ng', {
  9. 'lookup': salt['grains.filter_by']({
  10. 'Debian': {
  11. 'pkgs': {
  12. 'adodb': 'libphp-adodb',
  13. 'apache2': 'libapache2-mod-php' + phpng_version,
  14. 'apc': 'php-apcu',
  15. 'apcu': 'php-apcu-bc',
  16. 'bcmath': 'php' + phpng_version + '-bcmath',
  17. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  18. 'cache-lite': 'php-cache-lite',
  19. 'cgi': 'php' + phpng_version + '-cgi',
  20. 'cli': 'php' + phpng_version + '-cli',
  21. 'composer_bin': 'composer',
  22. 'console-table': 'php-console-table',
  23. 'curl': 'php' + phpng_version + '-curl',
  24. 'dev': 'php' + phpng_version + '-dev',
  25. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  26. 'fpm': 'php' + phpng_version + '-fpm',
  27. 'gd': 'php' + phpng_version + '-gd',
  28. 'gearman': 'php-gearman',
  29. 'geoip': 'php-geoip',
  30. 'geshi': 'php-geshi',
  31. 'gettext': 'php' + phpng_version,
  32. 'gmp': 'php' + phpng_version + '-gmp',
  33. 'hhvm': 'hhvm',
  34. 'imagick': 'php-imagick',
  35. 'imap': 'php' + phpng_version + '-imap',
  36. 'intl': 'php' + phpng_version + '-intl',
  37. 'json': 'php' + phpng_version + '-json',
  38. 'ldap': 'php' + phpng_version + '-ldap',
  39. 'local_bin': '/usr/local/bin',
  40. 'mbstring': 'php' + phpng_version + '-mbstring',
  41. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  42. 'memcache': 'php-memcache',
  43. 'memcached': 'php-memcached',
  44. 'mongo': 'php-mongo',
  45. 'mongodb': 'php-mongodb',
  46. 'mysql': 'php' + phpng_version + '-mysql',
  47. 'mysqlnd': 'php' + phpng_version + '-mysql',
  48. 'net4': 'php-net-ipv4',
  49. 'net6': 'php-net-ipv6',
  50. 'oauth': 'php-oauth',
  51. 'opcache': 'php' + phpng_version + '-opcache',
  52. 'pear': 'php-pear',
  53. 'pgsql': 'php' + phpng_version + '-pgsql',
  54. 'php': 'php' + phpng_version,
  55. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  56. 'pspell': 'php' + phpng_version + '-pspell',
  57. 'redis': 'php' + phpng_version + '-redis',
  58. 'seclib': ['php-phpseclib', 'php-seclib'],
  59. 'snmp': 'php' + phpng_version + '-snmp',
  60. 'soap': 'php' + phpng_version + '-soap',
  61. 'ssh2': 'php-ssh2',
  62. 'sqlite': 'php' + phpng_version + '-sqlite3',
  63. 'suhosin5_ext': 'suhosin.so',
  64. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  65. 'suhosin7_ext': 'suhosin7.so',
  66. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  67. 'tcpdf': 'php-tcpdf',
  68. 'temp_dir': '/tmp',
  69. 'tidy': 'php' + phpng_version + '-tidy',
  70. 'xdebug': 'php' + phpng_version + '-xdebug',
  71. 'xml': 'php' + phpng_version + '-xml',
  72. 'xsl': 'php' + phpng_version + '-xsl',
  73. 'zip': 'php' + phpng_version + '-zip',
  74. },
  75. 'fpm': {
  76. 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
  77. 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
  78. 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
  79. 'service': 'php' + phpng_version + '-fpm',
  80. 'defaults': odict([
  81. ('global', odict([
  82. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  83. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  84. ])),
  85. ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
  86. ]),
  87. },
  88. 'hhvm': {
  89. 'conf': '/etc/hhvm/server.ini',
  90. 'ini': '/etc/hhvm/php.ini',
  91. 'service': 'hhvm',
  92. 'defaults': {},
  93. 'server': odict([
  94. ('pid', '/var/run/hhvm/pid'),
  95. ('hhvm.server.port', '9000'),
  96. ('hhvm.server.type', 'fastcgi'),
  97. ('hhvm.server.default_document', 'index.php'),
  98. ('hhvm.log.use_log_file', 'true'),
  99. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  100. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  101. ]),
  102. 'php': odict([
  103. ('session.save_handler', 'files'),
  104. ('session.save_path', '/var/lib/hhvm/sessions'),
  105. ('session.gc_maxlifetime', '1440'),
  106. ('hhvm.log.level', 'Warning'),
  107. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  108. ('hhvm.log.runtime_error_reporting_level', '8191'),
  109. ('hhvm.mysql.typed_results', 'false'),
  110. ]),
  111. },
  112. 'cli': {
  113. 'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
  114. },
  115. 'apache2': {
  116. 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
  117. },
  118. },
  119. }),
  120. 'fpm': {
  121. 'service': {
  122. 'enabled': True,
  123. 'opts': {},
  124. },
  125. 'config': {
  126. 'ini': {
  127. 'opts': {},
  128. 'settings': {},
  129. },
  130. 'conf': {
  131. 'opts': {},
  132. 'settings': {},
  133. },
  134. },
  135. 'pools': {},
  136. },
  137. 'hhvm': {
  138. 'service': {
  139. 'enabled': True,
  140. 'opts': {},
  141. },
  142. 'config': {
  143. 'server': {
  144. 'opts': {},
  145. 'settings': {},
  146. },
  147. 'php': {
  148. 'opts': {},
  149. 'settings': {},
  150. },
  151. },
  152. },
  153. 'cli': {
  154. 'ini': {
  155. 'opts': {},
  156. 'settings': {},
  157. }
  158. },
  159. 'apache2': {
  160. 'ini': {
  161. 'opts': {},
  162. 'settings': {},
  163. }
  164. },
  165. 'ini': {
  166. 'defaults': {
  167. 'PHP': {
  168. 'allow_url_fopen': 'On',
  169. 'allow_url_include': 'Off',
  170. 'asp_tags': 'Off',
  171. 'auto_globals_jit': 'On',
  172. 'default_mimetype': '"text/html"',
  173. 'default_socket_timeout': 60,
  174. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  175. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  176. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  177. 'display_errors': 'Off',
  178. 'display_startup_errors': 'Off',
  179. 'enable_dl': 'Off',
  180. 'engine': 'On',
  181. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  182. 'expose_php': 'On',
  183. 'file_uploads': 'On',
  184. 'html_errors': 'On',
  185. 'ignore_repeated_errors': 'Off',
  186. 'ignore_repeated_source': 'Off',
  187. 'implicit_flush': 'Off',
  188. 'log_errors': 'On',
  189. 'log_errors_max_len': 1024,
  190. 'max_execution_time': 30,
  191. 'max_file_uploads': 20,
  192. 'max_input_nesting_level': 64,
  193. 'max_input_time': 60,
  194. 'max_input_vars': 1000,
  195. 'memory_limit': '128M',
  196. 'output_buffering': 4096,
  197. 'post_max_size': '8M',
  198. 'precision': 14,
  199. 'register_argc_argv': 'Off',
  200. 'report_memleaks': 'On',
  201. 'request_order': 'GP',
  202. 'serialize_precision': 17,
  203. 'short_open_tag': 'Off',
  204. 'track_errors': 'Off',
  205. 'upload_max_filesize': '2M',
  206. 'variables_order': 'GPCS',
  207. 'zend.enable_gc': 'On',
  208. 'zlib.output_compression': 'Off',
  209. },
  210. 'CLI Server': {
  211. 'cli_server.color': 'On'
  212. },
  213. 'Date': {
  214. 'date.timezone': 'America/New_York'
  215. },
  216. 'Pdo_mysql': {
  217. 'pdo_mysql.cache_size': 2000
  218. },
  219. 'mail function': {
  220. 'SMTP': 'localhost',
  221. 'mail.add_x_header': 'On'
  222. },
  223. 'SQL': {
  224. 'sql.safe_mode': 'Off'
  225. },
  226. 'ODBC': {
  227. 'odbc.allow_persistent': 'On',
  228. 'odbc.check_persistent': 'On',
  229. 'odbc.max_persistent': '-1',
  230. 'odbc.max_links': '-1',
  231. 'odbc.defaultlrl': 4096,
  232. 'odbc.defaultbinmode': 1
  233. },
  234. 'Interbase': {
  235. 'ibase.allow_persistent': 1,
  236. 'ibase.max_persistent': -1,
  237. 'ibase.max_links': -1,
  238. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  239. 'ibase.dateformat': '"%Y-%m-%d"',
  240. 'ibase.timeformat': '"%H:%M:%S"'
  241. },
  242. 'MySQL': {
  243. 'mysql.allow_local_infile': 'On',
  244. 'mysql.allow_persistent': 'On',
  245. 'mysql.cache_size': '2000',
  246. 'mysql.max_persistent': -1,
  247. 'mysql.max_links': -1,
  248. 'mysql.connect_timeout': 60,
  249. 'mysql.trace_mode': 'Off'
  250. },
  251. 'MySQLi': {
  252. 'mysqli.max_persistent': -1,
  253. 'mysqli.allow_persistent': 'On',
  254. 'mysqli.max_links': -1,
  255. 'mysqli.cache_size': 2000,
  256. 'mysqli.default_port': 3306,
  257. 'mysqli.reconnect': 'Off'
  258. },
  259. 'mysqlnd': {
  260. 'mysqlnd.collect_statistics': 'On',
  261. 'mysqlnd.collect_memory_statistics': 'Off'
  262. },
  263. 'PostgreSQL': {
  264. 'pgsql.allow_persistent': 'On',
  265. 'pgsql.auto_reset_persistent': 'Off',
  266. 'pgsql.max_persistent': -1,
  267. 'pgsql.max_links': -1,
  268. 'pgsql.ignore_notice': 0,
  269. 'pgsql.log_notice': 0
  270. },
  271. 'Sybase-CT': {
  272. 'sybct.allow_persistent': 'On',
  273. 'sybct.max_persistent': -1,
  274. 'sybct.max_links': -1,
  275. 'sybct.min_server_severity': 10,
  276. 'sybct.min_client_severity': 10
  277. },
  278. 'bcmath': {
  279. 'bcmath.scale': 0
  280. },
  281. 'Session': {
  282. 'session.save_handler': 'files',
  283. 'session.use_strict_mode': 0,
  284. 'session.use_cookies': 1,
  285. 'session.use_only_cookies': 1,
  286. 'session.name': 'PHPSESSID',
  287. 'session.auto_start': 0,
  288. 'session.cookie_lifetime': 0,
  289. 'session.cookie_path': '/',
  290. 'session.serialize_handler': 'php',
  291. 'session.gc_probability': 0,
  292. 'session.gc_divisor': 1000,
  293. 'session.gc_maxlifetime': 1440,
  294. 'session.bug_compat_42': 'Off',
  295. 'session.bug_compat_warn': 'Off',
  296. 'session.cache_limiter': 'nocache',
  297. 'session.cache_expire': '180',
  298. 'session.use_trans_sid': 0,
  299. 'session.hash_function': 0,
  300. 'session.hash_bits_per_character': 5,
  301. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  302. },
  303. 'MSSQL': {
  304. 'mssql.allow_persistent': 'On',
  305. 'mssql.max_persistent': -1,
  306. 'mssql.max_links': -1,
  307. 'mssql.min_error_severity': 10,
  308. 'mssql.min_message_severity': 10,
  309. 'mssql.compatibility_mode': 'Off',
  310. 'mssql.secure_connection': 'Off'
  311. },
  312. 'Tidy': {
  313. 'tidy.clean_output': 'Off'
  314. },
  315. 'soap': {
  316. 'soap.wsdl_cache_enabled': 1,
  317. 'soap.wsdl_cache_dir': '"/tmp"',
  318. 'soap.wsdl_cache_ttl': 86400,
  319. 'soap.wsdl_cache_limit': 5
  320. },
  321. 'ldap': {
  322. 'ldap.max_links': -1
  323. },
  324. },
  325. },
  326. }, merge=True) %}
  327. {%- else %}
  328. {%- set php = salt['pillar.get']('php:ng', {
  329. 'lookup': salt['grains.filter_by']({
  330. 'Debian': {
  331. 'pkgs': {
  332. 'adodb': 'libphp-adodb',
  333. 'apache2': 'libapache2-mod-php' + phpng_version,
  334. 'apc': 'php-apcu',
  335. 'apcu': 'php-apcu-bc',
  336. 'bcmath': 'php' + phpng_version + '-bcmath',
  337. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  338. 'cache-lite': 'php-cache-lite',
  339. 'cgi': 'php' + phpng_version + '-cgi',
  340. 'cli': 'php' + phpng_version + '-cli',
  341. 'composer_bin': 'composer',
  342. 'console-table': 'php-console-table',
  343. 'curl': 'php' + phpng_version + '-curl',
  344. 'dev': 'php' + phpng_version + '-dev',
  345. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  346. 'fpm': 'php' + phpng_version + '-fpm',
  347. 'gd': 'php' + phpng_version + '-gd',
  348. 'gearman': 'php-gearman',
  349. 'geoip': 'php-geoip',
  350. 'geshi': 'php-geshi',
  351. 'gettext': 'php' + phpng_version,
  352. 'gmp': 'php' + phpng_version + '-gmp',
  353. 'hhvm': 'hhvm',
  354. 'imagick': 'php-imagick',
  355. 'imap': 'php' + phpng_version + '-imap',
  356. 'intl': 'php' + phpng_version + '-intl',
  357. 'json': 'php' + phpng_version + '-json',
  358. 'ldap': 'php' + phpng_version + '-ldap',
  359. 'local_bin': '/usr/local/bin',
  360. 'mbstring': 'php' + phpng_version + '-mbstring',
  361. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  362. 'memcache': 'php-memcache',
  363. 'memcached': 'php-memcached',
  364. 'mongo': 'php-mongo',
  365. 'mongodb': 'php-mongodb',
  366. 'mysql': 'php' + phpng_version + '-mysql',
  367. 'mysqlnd': 'php' + phpng_version + '-mysql',
  368. 'net4': 'php-net-ipv4',
  369. 'net6': 'php-net-ipv6',
  370. 'oauth': 'php-oauth',
  371. 'opcache': 'php' + phpng_version + '-opcache',
  372. 'pear': 'php-pear',
  373. 'pgsql': 'php' + phpng_version + '-pgsql',
  374. 'php': 'php' + phpng_version,
  375. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  376. 'pspell': 'php' + phpng_version + '-pspell',
  377. 'redis': 'php' + phpng_version + '-redis',
  378. 'seclib': 'php-seclib',
  379. 'snmp': 'php' + phpng_version + '-snmp',
  380. 'soap': 'php' + phpng_version + '-soap',
  381. 'ssh2': 'php-ssh2',
  382. 'sqlite': 'php' + phpng_version + '-sqlite3',
  383. 'suhosin5_ext': 'suhosin.so',
  384. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  385. 'suhosin7_ext': 'suhosin7.so',
  386. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  387. 'tcpdf': 'php-tcpdf',
  388. 'temp_dir': '/tmp',
  389. 'tidy': 'php' + phpng_version + '-tidy',
  390. 'xdebug': 'php' + phpng_version + '-xdebug',
  391. 'xml': 'php' + phpng_version + '-xml',
  392. 'xsl': 'php' + phpng_version + '-xsl',
  393. 'zip': 'php' + phpng_version + '-zip',
  394. },
  395. 'fpm': {
  396. 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
  397. 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
  398. 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
  399. 'service': 'php' + phpng_version + '-fpm',
  400. 'defaults': odict([
  401. ('global', odict([
  402. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  403. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  404. ])),
  405. ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
  406. ]),
  407. },
  408. 'hhvm': {
  409. 'conf': '/etc/hhvm/server.ini',
  410. 'ini': '/etc/hhvm/php.ini',
  411. 'service': 'hhvm',
  412. 'defaults': {},
  413. 'server': odict([
  414. ('pid', '/var/run/hhvm/pid'),
  415. ('hhvm.server.port', '9000'),
  416. ('hhvm.server.type', 'fastcgi'),
  417. ('hhvm.server.default_document', 'index.php'),
  418. ('hhvm.log.use_log_file', 'true'),
  419. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  420. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  421. ]),
  422. 'php': odict([
  423. ('session.save_handler', 'files'),
  424. ('session.save_path', '/var/lib/hhvm/sessions'),
  425. ('session.gc_maxlifetime', '1440'),
  426. ('hhvm.log.level', 'Warning'),
  427. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  428. ('hhvm.log.runtime_error_reporting_level', '8191'),
  429. ('hhvm.mysql.typed_results', 'false'),
  430. ]),
  431. },
  432. 'cli': {
  433. 'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
  434. },
  435. 'apache2': {
  436. 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
  437. },
  438. },
  439. }),
  440. 'fpm': {
  441. 'service': {
  442. 'enabled': True,
  443. 'opts': {},
  444. },
  445. 'config': {
  446. 'ini': {
  447. 'opts': {},
  448. 'settings': {},
  449. },
  450. 'conf': {
  451. 'opts': {},
  452. 'settings': {},
  453. },
  454. },
  455. 'pools': {},
  456. },
  457. 'hhvm': {
  458. 'service': {
  459. 'enabled': True,
  460. 'opts': {},
  461. },
  462. 'config': {
  463. 'server': {
  464. 'opts': {},
  465. 'settings': {},
  466. },
  467. 'php': {
  468. 'opts': {},
  469. 'settings': {},
  470. },
  471. },
  472. },
  473. 'cli': {
  474. 'ini': {
  475. 'opts': {},
  476. 'settings': {},
  477. }
  478. },
  479. 'apache2': {
  480. 'ini': {
  481. 'opts': {},
  482. 'settings': {},
  483. }
  484. },
  485. 'ini': {
  486. 'defaults': {
  487. 'PHP': {
  488. 'allow_url_fopen': 'On',
  489. 'allow_url_include': 'Off',
  490. 'asp_tags': 'Off',
  491. 'auto_globals_jit': 'On',
  492. 'default_mimetype': '"text/html"',
  493. 'default_socket_timeout': 60,
  494. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  495. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  496. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  497. 'display_errors': 'Off',
  498. 'display_startup_errors': 'Off',
  499. 'enable_dl': 'Off',
  500. 'engine': 'On',
  501. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  502. 'expose_php': 'On',
  503. 'file_uploads': 'On',
  504. 'html_errors': 'On',
  505. 'ignore_repeated_errors': 'Off',
  506. 'ignore_repeated_source': 'Off',
  507. 'implicit_flush': 'Off',
  508. 'log_errors': 'On',
  509. 'log_errors_max_len': 1024,
  510. 'max_execution_time': 30,
  511. 'max_file_uploads': 20,
  512. 'max_input_nesting_level': 64,
  513. 'max_input_time': 60,
  514. 'max_input_vars': 1000,
  515. 'memory_limit': '128M',
  516. 'output_buffering': 4096,
  517. 'post_max_size': '8M',
  518. 'precision': 14,
  519. 'register_argc_argv': 'Off',
  520. 'report_memleaks': 'On',
  521. 'request_order': 'GP',
  522. 'serialize_precision': 17,
  523. 'short_open_tag': 'Off',
  524. 'track_errors': 'Off',
  525. 'upload_max_filesize': '2M',
  526. 'variables_order': 'GPCS',
  527. 'zend.enable_gc': 'On',
  528. 'zlib.output_compression': 'Off',
  529. },
  530. 'CLI Server': {
  531. 'cli_server.color': 'On'
  532. },
  533. 'Date': {
  534. 'date.timezone': 'America/New_York'
  535. },
  536. 'Pdo_mysql': {
  537. 'pdo_mysql.cache_size': 2000
  538. },
  539. 'mail function': {
  540. 'SMTP': 'localhost',
  541. 'mail.add_x_header': 'On'
  542. },
  543. 'SQL': {
  544. 'sql.safe_mode': 'Off'
  545. },
  546. 'ODBC': {
  547. 'odbc.allow_persistent': 'On',
  548. 'odbc.check_persistent': 'On',
  549. 'odbc.max_persistent': '-1',
  550. 'odbc.max_links': '-1',
  551. 'odbc.defaultlrl': 4096,
  552. 'odbc.defaultbinmode': 1
  553. },
  554. 'Interbase': {
  555. 'ibase.allow_persistent': 1,
  556. 'ibase.max_persistent': -1,
  557. 'ibase.max_links': -1,
  558. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  559. 'ibase.dateformat': '"%Y-%m-%d"',
  560. 'ibase.timeformat': '"%H:%M:%S"'
  561. },
  562. 'MySQL': {
  563. 'mysql.allow_local_infile': 'On',
  564. 'mysql.allow_persistent': 'On',
  565. 'mysql.cache_size': '2000',
  566. 'mysql.max_persistent': -1,
  567. 'mysql.max_links': -1,
  568. 'mysql.connect_timeout': 60,
  569. 'mysql.trace_mode': 'Off'
  570. },
  571. 'MySQLi': {
  572. 'mysqli.max_persistent': -1,
  573. 'mysqli.allow_persistent': 'On',
  574. 'mysqli.max_links': -1,
  575. 'mysqli.cache_size': 2000,
  576. 'mysqli.default_port': 3306,
  577. 'mysqli.reconnect': 'Off'
  578. },
  579. 'mysqlnd': {
  580. 'mysqlnd.collect_statistics': 'On',
  581. 'mysqlnd.collect_memory_statistics': 'Off'
  582. },
  583. 'PostgreSQL': {
  584. 'pgsql.allow_persistent': 'On',
  585. 'pgsql.auto_reset_persistent': 'Off',
  586. 'pgsql.max_persistent': -1,
  587. 'pgsql.max_links': -1,
  588. 'pgsql.ignore_notice': 0,
  589. 'pgsql.log_notice': 0
  590. },
  591. 'Sybase-CT': {
  592. 'sybct.allow_persistent': 'On',
  593. 'sybct.max_persistent': -1,
  594. 'sybct.max_links': -1,
  595. 'sybct.min_server_severity': 10,
  596. 'sybct.min_client_severity': 10
  597. },
  598. 'bcmath': {
  599. 'bcmath.scale': 0
  600. },
  601. 'Session': {
  602. 'session.save_handler': 'files',
  603. 'session.use_strict_mode': 0,
  604. 'session.use_cookies': 1,
  605. 'session.use_only_cookies': 1,
  606. 'session.name': 'PHPSESSID',
  607. 'session.auto_start': 0,
  608. 'session.cookie_lifetime': 0,
  609. 'session.cookie_path': '/',
  610. 'session.serialize_handler': 'php',
  611. 'session.gc_probability': 0,
  612. 'session.gc_divisor': 1000,
  613. 'session.gc_maxlifetime': 1440,
  614. 'session.bug_compat_42': 'Off',
  615. 'session.bug_compat_warn': 'Off',
  616. 'session.cache_limiter': 'nocache',
  617. 'session.cache_expire': '180',
  618. 'session.use_trans_sid': 0,
  619. 'session.hash_function': 0,
  620. 'session.hash_bits_per_character': 5,
  621. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  622. },
  623. 'MSSQL': {
  624. 'mssql.allow_persistent': 'On',
  625. 'mssql.max_persistent': -1,
  626. 'mssql.max_links': -1,
  627. 'mssql.min_error_severity': 10,
  628. 'mssql.min_message_severity': 10,
  629. 'mssql.compatibility_mode': 'Off',
  630. 'mssql.secure_connection': 'Off'
  631. },
  632. 'Tidy': {
  633. 'tidy.clean_output': 'Off'
  634. },
  635. 'soap': {
  636. 'soap.wsdl_cache_enabled': 1,
  637. 'soap.wsdl_cache_dir': '"/tmp"',
  638. 'soap.wsdl_cache_ttl': 86400,
  639. 'soap.wsdl_cache_limit': 5
  640. },
  641. 'ldap': {
  642. 'ldap.max_links': -1
  643. },
  644. },
  645. },
  646. }, merge=True) %}
  647. {%- endif %}
  648. {%- else %}
  649. {%- if salt['grains.get']('osrelease')|string >= '16.04' %}
  650. {%- set php = salt['pillar.get']('php:ng', {
  651. 'lookup': salt['grains.filter_by']({
  652. 'Ubuntu': {
  653. 'pkgs': {
  654. 'adodb': 'libphp-adodb',
  655. 'apache2': 'libapache2-mod-php',
  656. 'apc': 'php',
  657. 'apcu': 'php-apcu',
  658. 'bcmath': 'php7.0-bcmath',
  659. 'cache-lite': 'php-cache-lite',
  660. 'cgi': 'php-cgi',
  661. 'cli': 'php-cli',
  662. 'console-table': 'php-console-table',
  663. 'curl': 'php-curl',
  664. 'dev': 'php7.0-dev',
  665. 'fpm': 'php-fpm',
  666. 'gd': 'php-gd',
  667. 'geoip': 'php-geoip',
  668. 'geshi': 'php-geshi',
  669. 'gmp': 'php-gmp',
  670. 'hhvm': 'hhvm',
  671. 'imagick': 'php-imagick',
  672. 'imap': 'php-imap',
  673. 'intl': 'php-intl',
  674. 'json': 'php-json',
  675. 'ldap': 'php-ldap',
  676. 'mbstring': 'php-mbstring',
  677. 'mcrypt': 'php-mcrypt',
  678. 'memcache': 'php-memcache',
  679. 'memcached': 'php-memcached',
  680. 'mongodb': 'php-mongodb',
  681. 'mysql': 'php-mysql',
  682. 'mysqlnd': 'php',
  683. 'net4': 'php-net-ipv4',
  684. 'net6': 'php-net-ipv6',
  685. 'oauth': 'php-oauth',
  686. 'opcache': 'php7.0-opcache',
  687. 'pear': 'php-pear',
  688. 'pgsql': 'php-pgsql',
  689. 'php': 'php',
  690. 'phpenmod_command': 'phpenmod',
  691. 'pspell': 'php-pspell',
  692. 'redis': 'php-redis',
  693. 'seclib': ['php-phpseclib', 'php-seclib'],
  694. 'snmp': 'php-snmp',
  695. 'soap': 'php-soap',
  696. 'sqlite': 'php-sqlite3',
  697. 'ssh2': 'php-ssh2',
  698. 'suhosin': 'php',
  699. 'tcpdf': 'php-tcpdf',
  700. 'tidy': 'php7.0-tidy',
  701. 'xcache': 'php',
  702. 'xdebug': 'php-xdebug',
  703. 'xml': 'php-xml',
  704. 'xsl': 'php7.0-xsl',
  705. 'zip': 'php-zip',
  706. },
  707. 'fpm': {
  708. 'conf': '/etc/php/7.0/fpm/php-fpm.conf',
  709. 'ini': '/etc/php/7.0/fpm/php.ini',
  710. 'pools': '/etc/php/7.0/fpm/pool.d',
  711. 'service': 'php7.0-fpm',
  712. 'defaults': odict([
  713. ('global', odict([
  714. ('pid', '/var/run/php7.0-fpm.pid'),
  715. ('error_log', '/var/log/php7.0-fpm.log'),
  716. ])),
  717. ('include', '/etc/php/7.0/fpm/pool.d/*.conf'),
  718. ]),
  719. },
  720. 'hhvm': {
  721. 'conf': '/etc/hhvm/server.ini',
  722. 'ini': '/etc/hhvm/php.ini',
  723. 'service': 'hhvm',
  724. 'defaults': {},
  725. 'server': odict([
  726. ('pid', '/var/run/hhvm/pid'),
  727. ('hhvm.server.port', '9000'),
  728. ('hhvm.server.type', 'fastcgi'),
  729. ('hhvm.server.default_document', 'index.php'),
  730. ('hhvm.log.use_log_file', 'true'),
  731. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  732. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  733. ]),
  734. 'php': odict([
  735. ('session.save_handler', 'files'),
  736. ('session.save_path', '/var/lib/hhvm/sessions'),
  737. ('session.gc_maxlifetime', '1440'),
  738. ('hhvm.log.level', 'Warning'),
  739. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  740. ('hhvm.log.runtime_error_reporting_level', '8191'),
  741. ('hhvm.mysql.typed_results', 'false'),
  742. ]),
  743. },
  744. 'cli': {
  745. 'ini': '/etc/php/7.0/cli/php.ini',
  746. },
  747. 'apache2': {
  748. 'ini': '/etc/php/7.0/apache2/php.ini',
  749. },
  750. 'xcache': {
  751. 'ini': '/etc/php/7.0/mods-available/xcache.ini',
  752. 'defaults': {},
  753. },
  754. },
  755. }, grain="os"),
  756. 'fpm': {
  757. 'service': {
  758. 'enabled': True,
  759. 'opts': {},
  760. },
  761. 'config': {
  762. 'ini': {
  763. 'opts': {},
  764. 'settings': {},
  765. },
  766. 'conf': {
  767. 'opts': {},
  768. 'settings': {},
  769. },
  770. },
  771. 'pools': {
  772. 'default.conf': {
  773. 'enabled': False,
  774. 'opts': {},
  775. },
  776. },
  777. },
  778. 'hhvm': {
  779. 'service': {
  780. 'enabled': True,
  781. 'opts': {},
  782. },
  783. 'config': {
  784. 'server': {
  785. 'opts': {},
  786. 'settings': {},
  787. },
  788. 'php': {
  789. 'opts': {},
  790. 'settings': {},
  791. },
  792. },
  793. },
  794. 'cli': {
  795. 'ini': {
  796. 'opts': {},
  797. 'settings': {},
  798. }
  799. },
  800. 'apache2': {
  801. 'ini': {
  802. 'opts': {},
  803. 'settings': {},
  804. }
  805. },
  806. 'xcache': {
  807. 'ini': {
  808. 'defaults': {
  809. 'xcache-common': {
  810. 'extension': 'xcache.so',
  811. },
  812. 'xcache.admin': {
  813. 'xcache.admin.enable_auth': 'On',
  814. },
  815. 'xcache': {
  816. 'xcache.shm_scheme': '"mmap"',
  817. 'xcache.size': '60M',
  818. 'xcache.count': '1',
  819. 'xcache.slots': '8K',
  820. 'xcache.ttl': '0',
  821. 'xcache.gc_interval': '0',
  822. 'xcache.var_size': '4M',
  823. 'xcache.var_count': '1',
  824. 'xcache.var_slots': '8K',
  825. 'xcache.var_ttl': '0',
  826. 'xcache.var_maxttl': '0',
  827. 'xcache.var_gc_interval': '300',
  828. 'xcache.var_namespace_mode': '0',
  829. 'xcache.var_namespace': '""',
  830. 'xcache.readonly_protection': 'Off',
  831. 'xcache.mmap_path': '"/dev/zero"',
  832. 'xcache.coredump_directory': '""',
  833. 'xcache.coredump_type': '0',
  834. 'xcache.disable_on_crash': 'Off',
  835. 'xcache.experimental': 'Off',
  836. 'xcache.cacher': 'On',
  837. 'xcache.stat': 'On',
  838. 'xcache.optimizer': 'Off',
  839. },
  840. 'xcache.coverager': {
  841. 'xcache.coverager': 'Off',
  842. 'xcache.coverager_autostart': 'On',
  843. 'xcache.coveragedump_directory': '""',
  844. },
  845. },
  846. 'opts': {},
  847. 'settings': {},
  848. }
  849. },
  850. 'ini': {
  851. 'defaults': {
  852. 'PHP': {
  853. 'allow_url_fopen': 'On',
  854. 'allow_url_include': 'Off',
  855. 'asp_tags': 'Off',
  856. 'auto_globals_jit': 'On',
  857. 'default_mimetype': '"text/html"',
  858. 'default_socket_timeout': 60,
  859. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  860. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  861. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  862. 'display_errors': 'Off',
  863. 'display_startup_errors': 'Off',
  864. 'enable_dl': 'Off',
  865. 'engine': 'On',
  866. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  867. 'expose_php': 'On',
  868. 'file_uploads': 'On',
  869. 'html_errors': 'On',
  870. 'ignore_repeated_errors': 'Off',
  871. 'ignore_repeated_source': 'Off',
  872. 'implicit_flush': 'Off',
  873. 'log_errors': 'On',
  874. 'log_errors_max_len': 1024,
  875. 'max_execution_time': 30,
  876. 'max_file_uploads': 20,
  877. 'max_input_nesting_level': 64,
  878. 'max_input_time': 60,
  879. 'max_input_vars': 1000,
  880. 'memory_limit': '128M',
  881. 'output_buffering': 4096,
  882. 'post_max_size': '8M',
  883. 'precision': 14,
  884. 'register_argc_argv': 'Off',
  885. 'report_memleaks': 'On',
  886. 'request_order': 'GP',
  887. 'serialize_precision': 17,
  888. 'short_open_tag': 'Off',
  889. 'track_errors': 'Off',
  890. 'upload_max_filesize': '2M',
  891. 'variables_order': 'GPCS',
  892. 'zend.enable_gc': 'On',
  893. 'zlib.output_compression': 'Off',
  894. },
  895. 'CLI Server': {
  896. 'cli_server.color': 'On'
  897. },
  898. 'Date': {
  899. 'date.timezone': 'America/New_York'
  900. },
  901. 'Pdo_mysql': {
  902. 'pdo_mysql.cache_size': 2000
  903. },
  904. 'mail function': {
  905. 'SMTP': 'localhost',
  906. 'mail.add_x_header': 'On'
  907. },
  908. 'SQL': {
  909. 'sql.safe_mode': 'Off'
  910. },
  911. 'ODBC': {
  912. 'odbc.allow_persistent': 'On',
  913. 'odbc.check_persistent': 'On',
  914. 'odbc.max_persistent': '-1',
  915. 'odbc.max_links': '-1',
  916. 'odbc.defaultlrl': 4096,
  917. 'odbc.defaultbinmode': 1
  918. },
  919. 'Interbase': {
  920. 'ibase.allow_persistent': 1,
  921. 'ibase.max_persistent': -1,
  922. 'ibase.max_links': -1,
  923. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  924. 'ibase.dateformat': '"%Y-%m-%d"',
  925. 'ibase.timeformat': '"%H:%M:%S"'
  926. },
  927. 'MySQL': {
  928. 'mysql.allow_local_infile': 'On',
  929. 'mysql.allow_persistent': 'On',
  930. 'mysql.cache_size': '2000',
  931. 'mysql.max_persistent': -1,
  932. 'mysql.max_links': -1,
  933. 'mysql.connect_timeout': 60,
  934. 'mysql.trace_mode': 'Off'
  935. },
  936. 'MySQLi': {
  937. 'mysqli.max_persistent': -1,
  938. 'mysqli.allow_persistent': 'On',
  939. 'mysqli.max_links': -1,
  940. 'mysqli.cache_size': 2000,
  941. 'mysqli.default_port': 3306,
  942. 'mysqli.reconnect': 'Off'
  943. },
  944. 'mysqlnd': {
  945. 'mysqlnd.collect_statistics': 'On',
  946. 'mysqlnd.collect_memory_statistics': 'Off'
  947. },
  948. 'PostgreSQL': {
  949. 'pgsql.allow_persistent': 'On',
  950. 'pgsql.auto_reset_persistent': 'Off',
  951. 'pgsql.max_persistent': -1,
  952. 'pgsql.max_links': -1,
  953. 'pgsql.ignore_notice': 0,
  954. 'pgsql.log_notice': 0
  955. },
  956. 'Sybase-CT': {
  957. 'sybct.allow_persistent': 'On',
  958. 'sybct.max_persistent': -1,
  959. 'sybct.max_links': -1,
  960. 'sybct.min_server_severity': 10,
  961. 'sybct.min_client_severity': 10
  962. },
  963. 'bcmath': {
  964. 'bcmath.scale': 0
  965. },
  966. 'Session': {
  967. 'session.save_handler': 'files',
  968. 'session.use_strict_mode': 0,
  969. 'session.use_cookies': 1,
  970. 'session.use_only_cookies': 1,
  971. 'session.name': 'PHPSESSID',
  972. 'session.auto_start': 0,
  973. 'session.cookie_lifetime': 0,
  974. 'session.cookie_path': '/',
  975. 'session.serialize_handler': 'php',
  976. 'session.gc_probability': 0,
  977. 'session.gc_divisor': 1000,
  978. 'session.gc_maxlifetime': 1440,
  979. 'session.bug_compat_42': 'Off',
  980. 'session.bug_compat_warn': 'Off',
  981. 'session.cache_limiter': 'nocache',
  982. 'session.cache_expire': '180',
  983. 'session.use_trans_sid': 0,
  984. 'session.hash_function': 0,
  985. 'session.hash_bits_per_character': 5,
  986. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  987. },
  988. 'MSSQL': {
  989. 'mssql.allow_persistent': 'On',
  990. 'mssql.max_persistent': -1,
  991. 'mssql.max_links': -1,
  992. 'mssql.min_error_severity': 10,
  993. 'mssql.min_message_severity': 10,
  994. 'mssql.compatibility_mode': 'Off',
  995. 'mssql.secure_connection': 'Off'
  996. },
  997. 'Tidy': {
  998. 'tidy.clean_output': 'Off'
  999. },
  1000. 'soap': {
  1001. 'soap.wsdl_cache_enabled': 1,
  1002. 'soap.wsdl_cache_dir': '"/tmp"',
  1003. 'soap.wsdl_cache_ttl': 86400,
  1004. 'soap.wsdl_cache_limit': 5
  1005. },
  1006. 'ldap': {
  1007. 'ldap.max_links': -1
  1008. },
  1009. },
  1010. },
  1011. }, merge=True) %}
  1012. {%- else %}
  1013. {%- set php = salt['pillar.get']('php:ng', {
  1014. 'lookup': salt['grains.filter_by']({
  1015. 'Ubuntu': {
  1016. 'pkgs': {
  1017. 'adodb': 'php5-adodb',
  1018. 'apache2': 'libapache2-mod-php5',
  1019. 'apc': 'php-apc',
  1020. 'apcu': 'php5-apcu',
  1021. 'bcmath': 'php5',
  1022. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
  1023. 'cache-lite': 'php-cache-lite',
  1024. 'cgi': 'php5-cgi',
  1025. 'cli': 'php5-cli',
  1026. 'composer_bin': 'composer',
  1027. 'console-table': 'php-console-table',
  1028. 'curl': 'php5-curl',
  1029. 'dev': ['php5-dev','build-essential'],
  1030. 'ext_conf_path': salt['grains.filter_by']({
  1031. 'precise': '/etc/php5/conf.d',
  1032. 'default': '/etc/php5/mods-available',
  1033. }, grain='oscodename'),
  1034. 'fpm': 'php5-fpm',
  1035. 'gd': 'php5-gd',
  1036. 'gearman': 'php5-gearman',
  1037. 'geoip': 'php5-geoip',
  1038. 'geshi': 'php-geshi',
  1039. 'gettext': 'php-gettext',
  1040. 'gmp': 'php5-gmp',
  1041. 'hhvm': 'hhvm',
  1042. 'imagick': 'php5-imagick',
  1043. 'imap': 'php5-imap',
  1044. 'intl': 'php5-intl',
  1045. 'json': 'php5-json',
  1046. 'ldap': 'php5-ldap',
  1047. 'local_bin': '/usr/local/bin',
  1048. 'mbstring': 'php5',
  1049. 'mcrypt': 'php5-mcrypt',
  1050. 'mdb2': 'php-mdb2',
  1051. 'mdb2-driver-mysql': 'php-mdb2-driver-mysql',
  1052. 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql',
  1053. 'memcache': 'php5-memcache',
  1054. 'memcached': 'php5-memcached',
  1055. 'mongodb': salt['grains.filter_by']({
  1056. 'trusty': 'php5-mongo',
  1057. 'default': '',
  1058. }, grain='oscodename'),
  1059. 'mysql': 'php5-mysql',
  1060. 'mysqlnd': 'php5-mysqlnd',
  1061. 'net4': 'php-net-ipv4',
  1062. 'net6': 'php-net-ipv6',
  1063. 'oauth': 'php5-oauth',
  1064. 'opcache': 'php5',
  1065. 'pear': 'php-pear',
  1066. 'pgsql': 'php5-pgsql',
  1067. 'php': 'php5',
  1068. 'phpenmod_command': salt['grains.filter_by']({
  1069. 'precise': 'true',
  1070. 'default': 'php5enmod',
  1071. }, grain='oscodename'),
  1072. 'pspell': 'php5-pspell',
  1073. 'redis': 'php5-redis',
  1074. 'seclib': 'php-seclib',
  1075. 'snmp': 'php5-snmp',
  1076. 'soap': 'php-soap',
  1077. 'sqlite': 'php5-sqlite',
  1078. 'ssh2': 'libssh2-php',
  1079. 'suhosin5_ext': 'suhosin.so',
  1080. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1081. 'suhosin7_ext': 'suhosin7.so',
  1082. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1083. 'svn': 'php5-svn',
  1084. 'tcpdf': 'php-tcpdf',
  1085. 'tidy': 'php5-tidy',
  1086. 'temp_dir': '/tmp',
  1087. 'xcache': 'php5-xcache',
  1088. 'xdebug': 'php5-xdebug',
  1089. 'xml': 'php5',
  1090. 'xsl': 'php5-xsl',
  1091. 'zip': 'php5',
  1092. },
  1093. 'fpm': {
  1094. 'conf': '/etc/php5/fpm/php-fpm.conf',
  1095. 'ini': '/etc/php5/fpm/php.ini',
  1096. 'pools': '/etc/php5/fpm/pool.d',
  1097. 'service': 'php5-fpm',
  1098. 'defaults': odict([
  1099. ('global', odict([
  1100. ('pid', '/var/run/php5-fpm.pid'),
  1101. ('error_log', '/var/log/php5-fpm.log'),
  1102. ])),
  1103. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  1104. ]),
  1105. },
  1106. 'hhvm': {
  1107. 'conf': '/etc/hhvm/server.ini',
  1108. 'ini': '/etc/hhvm/php.ini',
  1109. 'service': 'hhvm',
  1110. 'defaults': {},
  1111. 'server': odict([
  1112. ('pid', '/var/run/hhvm/pid'),
  1113. ('hhvm.server.port', '9000'),
  1114. ('hhvm.server.type', 'fastcgi'),
  1115. ('hhvm.server.default_document', 'index.php'),
  1116. ('hhvm.log.use_log_file', 'true'),
  1117. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1118. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1119. ]),
  1120. 'php': odict([
  1121. ('session.save_handler', 'files'),
  1122. ('session.save_path', '/var/lib/hhvm/sessions'),
  1123. ('session.gc_maxlifetime', '1440'),
  1124. ('hhvm.log.level', 'Warning'),
  1125. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1126. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1127. ('hhvm.mysql.typed_results', 'false'),
  1128. ]),
  1129. },
  1130. 'cli': {
  1131. 'ini': '/etc/php5/cli/php.ini',
  1132. },
  1133. 'apache2': {
  1134. 'ini': '/etc/php5/apache2/php.ini',
  1135. },
  1136. 'xcache': {
  1137. 'ini': '/etc/php5/mods-available/xcache.ini',
  1138. 'defaults': {},
  1139. },
  1140. },
  1141. }, grain="os"),
  1142. 'fpm': {
  1143. 'service': {
  1144. 'enabled': True,
  1145. 'opts': {},
  1146. },
  1147. 'config': {
  1148. 'ini': {
  1149. 'opts': {},
  1150. 'settings': {},
  1151. },
  1152. 'conf': {
  1153. 'opts': {},
  1154. 'settings': {},
  1155. },
  1156. },
  1157. 'pools': {
  1158. 'default.conf': {
  1159. 'enabled': False,
  1160. 'opts': {},
  1161. },
  1162. },
  1163. },
  1164. 'hhvm': {
  1165. 'service': {
  1166. 'enabled': True,
  1167. 'opts': {},
  1168. },
  1169. 'config': {
  1170. 'server': {
  1171. 'opts': {},
  1172. 'settings': {},
  1173. },
  1174. 'php': {
  1175. 'opts': {},
  1176. 'settings': {},
  1177. },
  1178. },
  1179. },
  1180. 'cli': {
  1181. 'ini': {
  1182. 'opts': {},
  1183. 'settings': {},
  1184. }
  1185. },
  1186. 'apache2': {
  1187. 'ini': {
  1188. 'opts': {},
  1189. 'settings': {},
  1190. }
  1191. },
  1192. 'xcache': {
  1193. 'ini': {
  1194. 'defaults': {
  1195. 'xcache-common': {
  1196. 'extension': 'xcache.so',
  1197. },
  1198. 'xcache.admin': {
  1199. 'xcache.admin.enable_auth': 'On',
  1200. },
  1201. 'xcache': {
  1202. 'xcache.shm_scheme': '"mmap"',
  1203. 'xcache.size': '60M',
  1204. 'xcache.count': '1',
  1205. 'xcache.slots': '8K',
  1206. 'xcache.ttl': '0',
  1207. 'xcache.gc_interval': '0',
  1208. 'xcache.var_size': '4M',
  1209. 'xcache.var_count': '1',
  1210. 'xcache.var_slots': '8K',
  1211. 'xcache.var_ttl': '0',
  1212. 'xcache.var_maxttl': '0',
  1213. 'xcache.var_gc_interval': '300',
  1214. 'xcache.var_namespace_mode': '0',
  1215. 'xcache.var_namespace': '""',
  1216. 'xcache.readonly_protection': 'Off',
  1217. 'xcache.mmap_path': '"/dev/zero"',
  1218. 'xcache.coredump_directory': '""',
  1219. 'xcache.coredump_type': '0',
  1220. 'xcache.disable_on_crash': 'Off',
  1221. 'xcache.experimental': 'Off',
  1222. 'xcache.cacher': 'On',
  1223. 'xcache.stat': 'On',
  1224. 'xcache.optimizer': 'Off',
  1225. },
  1226. 'xcache.coverager': {
  1227. 'xcache.coverager': 'Off',
  1228. 'xcache.coverager_autostart': 'On',
  1229. 'xcache.coveragedump_directory': '""',
  1230. },
  1231. },
  1232. 'opts': {},
  1233. 'settings': {},
  1234. }
  1235. },
  1236. 'ini': {
  1237. 'defaults': {
  1238. 'PHP': {
  1239. 'allow_url_fopen': 'On',
  1240. 'allow_url_include': 'Off',
  1241. 'asp_tags': 'Off',
  1242. 'auto_globals_jit': 'On',
  1243. 'default_mimetype': '"text/html"',
  1244. 'default_socket_timeout': 60,
  1245. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  1246. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  1247. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  1248. 'display_errors': 'Off',
  1249. 'display_startup_errors': 'Off',
  1250. 'enable_dl': 'Off',
  1251. 'engine': 'On',
  1252. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  1253. 'expose_php': 'On',
  1254. 'file_uploads': 'On',
  1255. 'html_errors': 'On',
  1256. 'ignore_repeated_errors': 'Off',
  1257. 'ignore_repeated_source': 'Off',
  1258. 'implicit_flush': 'Off',
  1259. 'log_errors': 'On',
  1260. 'log_errors_max_len': 1024,
  1261. 'max_execution_time': 30,
  1262. 'max_file_uploads': 20,
  1263. 'max_input_nesting_level': 64,
  1264. 'max_input_time': 60,
  1265. 'max_input_vars': 1000,
  1266. 'memory_limit': '128M',
  1267. 'output_buffering': 4096,
  1268. 'post_max_size': '8M',
  1269. 'precision': 14,
  1270. 'register_argc_argv': 'Off',
  1271. 'report_memleaks': 'On',
  1272. 'request_order': 'GP',
  1273. 'serialize_precision': 17,
  1274. 'short_open_tag': 'Off',
  1275. 'track_errors': 'Off',
  1276. 'upload_max_filesize': '2M',
  1277. 'variables_order': 'GPCS',
  1278. 'zend.enable_gc': 'On',
  1279. 'zlib.output_compression': 'Off',
  1280. },
  1281. 'CLI Server': {
  1282. 'cli_server.color': 'On'
  1283. },
  1284. 'Date': {
  1285. 'date.timezone': 'America/New_York'
  1286. },
  1287. 'Pdo_mysql': {
  1288. 'pdo_mysql.cache_size': 2000
  1289. },
  1290. 'mail function': {
  1291. 'SMTP': 'localhost',
  1292. 'mail.add_x_header': 'On'
  1293. },
  1294. 'SQL': {
  1295. 'sql.safe_mode': 'Off'
  1296. },
  1297. 'ODBC': {
  1298. 'odbc.allow_persistent': 'On',
  1299. 'odbc.check_persistent': 'On',
  1300. 'odbc.max_persistent': '-1',
  1301. 'odbc.max_links': '-1',
  1302. 'odbc.defaultlrl': 4096,
  1303. 'odbc.defaultbinmode': 1
  1304. },
  1305. 'Interbase': {
  1306. 'ibase.allow_persistent': 1,
  1307. 'ibase.max_persistent': -1,
  1308. 'ibase.max_links': -1,
  1309. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  1310. 'ibase.dateformat': '"%Y-%m-%d"',
  1311. 'ibase.timeformat': '"%H:%M:%S"'
  1312. },
  1313. 'MySQL': {
  1314. 'mysql.allow_local_infile': 'On',
  1315. 'mysql.allow_persistent': 'On',
  1316. 'mysql.cache_size': '2000',
  1317. 'mysql.max_persistent': -1,
  1318. 'mysql.max_links': -1,
  1319. 'mysql.connect_timeout': 60,
  1320. 'mysql.trace_mode': 'Off'
  1321. },
  1322. 'MySQLi': {
  1323. 'mysqli.max_persistent': -1,
  1324. 'mysqli.allow_persistent': 'On',
  1325. 'mysqli.max_links': -1,
  1326. 'mysqli.cache_size': 2000,
  1327. 'mysqli.default_port': 3306,
  1328. 'mysqli.reconnect': 'Off'
  1329. },
  1330. 'mysqlnd': {
  1331. 'mysqlnd.collect_statistics': 'On',
  1332. 'mysqlnd.collect_memory_statistics': 'Off'
  1333. },
  1334. 'PostgreSQL': {
  1335. 'pgsql.allow_persistent': 'On',
  1336. 'pgsql.auto_reset_persistent': 'Off',
  1337. 'pgsql.max_persistent': -1,
  1338. 'pgsql.max_links': -1,
  1339. 'pgsql.ignore_notice': 0,
  1340. 'pgsql.log_notice': 0
  1341. },
  1342. 'Sybase-CT': {
  1343. 'sybct.allow_persistent': 'On',
  1344. 'sybct.max_persistent': -1,
  1345. 'sybct.max_links': -1,
  1346. 'sybct.min_server_severity': 10,
  1347. 'sybct.min_client_severity': 10
  1348. },
  1349. 'bcmath': {
  1350. 'bcmath.scale': 0
  1351. },
  1352. 'Session': {
  1353. 'session.save_handler': 'files',
  1354. 'session.use_strict_mode': 0,
  1355. 'session.use_cookies': 1,
  1356. 'session.use_only_cookies': 1,
  1357. 'session.name': 'PHPSESSID',
  1358. 'session.auto_start': 0,
  1359. 'session.cookie_lifetime': 0,
  1360. 'session.cookie_path': '/',
  1361. 'session.serialize_handler': 'php',
  1362. 'session.gc_probability': 0,
  1363. 'session.gc_divisor': 1000,
  1364. 'session.gc_maxlifetime': 1440,
  1365. 'session.bug_compat_42': 'Off',
  1366. 'session.bug_compat_warn': 'Off',
  1367. 'session.cache_limiter': 'nocache',
  1368. 'session.cache_expire': '180',
  1369. 'session.use_trans_sid': 0,
  1370. 'session.hash_function': 0,
  1371. 'session.hash_bits_per_character': 5,
  1372. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1373. },
  1374. 'MSSQL': {
  1375. 'mssql.allow_persistent': 'On',
  1376. 'mssql.max_persistent': -1,
  1377. 'mssql.max_links': -1,
  1378. 'mssql.min_error_severity': 10,
  1379. 'mssql.min_message_severity': 10,
  1380. 'mssql.compatibility_mode': 'Off',
  1381. 'mssql.secure_connection': 'Off'
  1382. },
  1383. 'Tidy': {
  1384. 'tidy.clean_output': 'Off'
  1385. },
  1386. 'soap': {
  1387. 'soap.wsdl_cache_enabled': 1,
  1388. 'soap.wsdl_cache_dir': '"/tmp"',
  1389. 'soap.wsdl_cache_ttl': 86400,
  1390. 'soap.wsdl_cache_limit': 5
  1391. },
  1392. 'ldap': {
  1393. 'ldap.max_links': -1
  1394. },
  1395. },
  1396. },
  1397. }, merge=True) %}
  1398. {%- endif %}
  1399. {%- endif %}
  1400. {%- elif salt['grains.get']('os') == "Debian" %}
  1401. {%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
  1402. {%- set php = salt['pillar.get']('php:ng', {
  1403. 'lookup': salt['grains.filter_by']({
  1404. 'Debian': {
  1405. 'pkgs': {
  1406. 'adodb': 'libphp-adodb',
  1407. 'apache2': 'libapache2-mod-php' + phpng_version,
  1408. 'apc': 'php-apcu',
  1409. 'apcu': 'php-apcu-bc',
  1410. 'bcmath': 'php' + phpng_version + '-bcmath',
  1411. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  1412. 'cache-lite': 'php-cache-lite',
  1413. 'cgi': 'php' + phpng_version + '-cgi',
  1414. 'cli': 'php' + phpng_version + '-cli',
  1415. 'composer_bin': 'composer',
  1416. 'console-table': 'php-console-table',
  1417. 'curl': 'php' + phpng_version + '-curl',
  1418. 'dev': 'php' + phpng_version + '-dev',
  1419. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  1420. 'fpm': 'php' + phpng_version + '-fpm',
  1421. 'gd': 'php' + phpng_version + '-gd',
  1422. 'gearman': 'php-gearman',
  1423. 'geoip': 'php-geoip',
  1424. 'geshi': 'php-geshi',
  1425. 'gettext': 'php' + phpng_version,
  1426. 'gmp': 'php' + phpng_version + '-gmp',
  1427. 'hhvm': 'hhvm',
  1428. 'imagick': 'php-imagick',
  1429. 'imap': 'php' + phpng_version + '-imap',
  1430. 'intl': 'php' + phpng_version + '-intl',
  1431. 'json': 'php' + phpng_version + '-json',
  1432. 'ldap': 'php' + phpng_version + '-ldap',
  1433. 'local_bin': '/usr/local/bin',
  1434. 'mbstring': 'php' + phpng_version + '-mbstring',
  1435. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  1436. 'memcache': 'php-memcache',
  1437. 'memcached': 'php-memcached',
  1438. 'mongo': 'php-mongo',
  1439. 'mongodb': 'php-mongodb',
  1440. 'mysql': 'php' + phpng_version + '-mysql',
  1441. 'mysqlnd': 'php' + phpng_version + '-mysql',
  1442. 'net4': 'php-net-ipv4',
  1443. 'net6': 'php-net-ipv6',
  1444. 'oauth': 'php-oauth',
  1445. 'opcache': 'php' + phpng_version + '-opcache',
  1446. 'pear': 'php-pear',
  1447. 'pgsql': 'php' + phpng_version + '-pgsql',
  1448. 'php': 'php' + phpng_version,
  1449. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  1450. 'pspell': 'php' + phpng_version + '-pspell',
  1451. 'redis': 'php-redis',
  1452. 'seclib': ['php-phpseclib', 'php-seclib'],
  1453. 'snmp': 'php' + phpng_version + '-snmp',
  1454. 'soap': 'php' + phpng_version + '-soap',
  1455. 'ssh2': 'php-ssh2',
  1456. 'sqlite': 'php' + phpng_version + '-sqlite3',
  1457. 'suhosin5_ext': 'suhosin.so',
  1458. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1459. 'suhosin7_ext': 'suhosin7.so',
  1460. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1461. 'tcpdf': 'php-tcpdf',
  1462. 'temp_dir': '/tmp',
  1463. 'tidy': 'php' + phpng_version + '-tidy',
  1464. 'xdebug': 'php' + phpng_version + '-xdebug',
  1465. 'xml': 'php' + phpng_version + '-xml',
  1466. 'xsl': 'php' + phpng_version + '-xsl',
  1467. 'zip': 'php' + phpng_version + '-zip',
  1468. },
  1469. 'fpm': {
  1470. 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
  1471. 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
  1472. 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
  1473. 'service': 'php' + phpng_version + '-fpm',
  1474. 'defaults': odict([
  1475. ('global', odict([
  1476. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  1477. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  1478. ])),
  1479. ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
  1480. ]),
  1481. },
  1482. 'hhvm': {
  1483. 'conf': '/etc/hhvm/server.ini',
  1484. 'ini': '/etc/hhvm/php.ini',
  1485. 'service': 'hhvm',
  1486. 'defaults': {},
  1487. 'server': odict([
  1488. ('pid', '/var/run/hhvm/pid'),
  1489. ('hhvm.server.port', '9000'),
  1490. ('hhvm.server.type', 'fastcgi'),
  1491. ('hhvm.server.default_document', 'index.php'),
  1492. ('hhvm.log.use_log_file', 'true'),
  1493. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1494. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1495. ]),
  1496. 'php': odict([
  1497. ('session.save_handler', 'files'),
  1498. ('session.save_path', '/var/lib/hhvm/sessions'),
  1499. ('session.gc_maxlifetime', '1440'),
  1500. ('hhvm.log.level', 'Warning'),
  1501. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1502. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1503. ('hhvm.mysql.typed_results', 'false'),
  1504. ]),
  1505. },
  1506. 'cli': {
  1507. 'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
  1508. },
  1509. 'apache2': {
  1510. 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
  1511. },
  1512. },
  1513. }),
  1514. 'fpm': {
  1515. 'service': {
  1516. 'enabled': True,
  1517. 'opts': {},
  1518. },
  1519. 'config': {
  1520. 'ini': {
  1521. 'opts': {},
  1522. 'settings': {},
  1523. },
  1524. 'conf': {
  1525. 'opts': {},
  1526. 'settings': {},
  1527. },
  1528. },
  1529. 'pools': {},
  1530. },
  1531. 'hhvm': {
  1532. 'service': {
  1533. 'enabled': True,
  1534. 'opts': {},
  1535. },
  1536. 'config': {
  1537. 'server': {
  1538. 'opts': {},
  1539. 'settings': {},
  1540. },
  1541. 'php': {
  1542. 'opts': {},
  1543. 'settings': {},
  1544. },
  1545. },
  1546. },
  1547. 'cli': {
  1548. 'ini': {
  1549. 'opts': {},
  1550. 'settings': {},
  1551. }
  1552. },
  1553. 'apache2': {
  1554. 'ini': {
  1555. 'opts': {},
  1556. 'settings': {},
  1557. }
  1558. },
  1559. 'ini': {
  1560. 'defaults': {
  1561. 'PHP': {
  1562. 'allow_url_fopen': 'On',
  1563. 'allow_url_include': 'Off',
  1564. 'asp_tags': 'Off',
  1565. 'auto_globals_jit': 'On',
  1566. 'default_mimetype': '"text/html"',
  1567. 'default_socket_timeout': 60,
  1568. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  1569. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  1570. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  1571. 'display_errors': 'Off',
  1572. 'display_startup_errors': 'Off',
  1573. 'enable_dl': 'Off',
  1574. 'engine': 'On',
  1575. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  1576. 'expose_php': 'On',
  1577. 'file_uploads': 'On',
  1578. 'html_errors': 'On',
  1579. 'ignore_repeated_errors': 'Off',
  1580. 'ignore_repeated_source': 'Off',
  1581. 'implicit_flush': 'Off',
  1582. 'log_errors': 'On',
  1583. 'log_errors_max_len': 1024,
  1584. 'max_execution_time': 30,
  1585. 'max_file_uploads': 20,
  1586. 'max_input_nesting_level': 64,
  1587. 'max_input_time': 60,
  1588. 'max_input_vars': 1000,
  1589. 'memory_limit': '128M',
  1590. 'output_buffering': 4096,
  1591. 'post_max_size': '8M',
  1592. 'precision': 14,
  1593. 'register_argc_argv': 'Off',
  1594. 'report_memleaks': 'On',
  1595. 'request_order': 'GP',
  1596. 'serialize_precision': 17,
  1597. 'short_open_tag': 'Off',
  1598. 'track_errors': 'Off',
  1599. 'upload_max_filesize': '2M',
  1600. 'variables_order': 'GPCS',
  1601. 'zend.enable_gc': 'On',
  1602. 'zlib.output_compression': 'Off',
  1603. },
  1604. 'CLI Server': {
  1605. 'cli_server.color': 'On'
  1606. },
  1607. 'Date': {
  1608. 'date.timezone': 'America/New_York'
  1609. },
  1610. 'Pdo_mysql': {
  1611. 'pdo_mysql.cache_size': 2000
  1612. },
  1613. 'mail function': {
  1614. 'SMTP': 'localhost',
  1615. 'mail.add_x_header': 'On'
  1616. },
  1617. 'SQL': {
  1618. 'sql.safe_mode': 'Off'
  1619. },
  1620. 'ODBC': {
  1621. 'odbc.allow_persistent': 'On',
  1622. 'odbc.check_persistent': 'On',
  1623. 'odbc.max_persistent': '-1',
  1624. 'odbc.max_links': '-1',
  1625. 'odbc.defaultlrl': 4096,
  1626. 'odbc.defaultbinmode': 1
  1627. },
  1628. 'Interbase': {
  1629. 'ibase.allow_persistent': 1,
  1630. 'ibase.max_persistent': -1,
  1631. 'ibase.max_links': -1,
  1632. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  1633. 'ibase.dateformat': '"%Y-%m-%d"',
  1634. 'ibase.timeformat': '"%H:%M:%S"'
  1635. },
  1636. 'MySQL': {
  1637. 'mysql.allow_local_infile': 'On',
  1638. 'mysql.allow_persistent': 'On',
  1639. 'mysql.cache_size': '2000',
  1640. 'mysql.max_persistent': -1,
  1641. 'mysql.max_links': -1,
  1642. 'mysql.connect_timeout': 60,
  1643. 'mysql.trace_mode': 'Off'
  1644. },
  1645. 'MySQLi': {
  1646. 'mysqli.max_persistent': -1,
  1647. 'mysqli.allow_persistent': 'On',
  1648. 'mysqli.max_links': -1,
  1649. 'mysqli.cache_size': 2000,
  1650. 'mysqli.default_port': 3306,
  1651. 'mysqli.reconnect': 'Off'
  1652. },
  1653. 'mysqlnd': {
  1654. 'mysqlnd.collect_statistics': 'On',
  1655. 'mysqlnd.collect_memory_statistics': 'Off'
  1656. },
  1657. 'PostgreSQL': {
  1658. 'pgsql.allow_persistent': 'On',
  1659. 'pgsql.auto_reset_persistent': 'Off',
  1660. 'pgsql.max_persistent': -1,
  1661. 'pgsql.max_links': -1,
  1662. 'pgsql.ignore_notice': 0,
  1663. 'pgsql.log_notice': 0
  1664. },
  1665. 'Sybase-CT': {
  1666. 'sybct.allow_persistent': 'On',
  1667. 'sybct.max_persistent': -1,
  1668. 'sybct.max_links': -1,
  1669. 'sybct.min_server_severity': 10,
  1670. 'sybct.min_client_severity': 10
  1671. },
  1672. 'bcmath': {
  1673. 'bcmath.scale': 0
  1674. },
  1675. 'Session': {
  1676. 'session.save_handler': 'files',
  1677. 'session.use_strict_mode': 0,
  1678. 'session.use_cookies': 1,
  1679. 'session.use_only_cookies': 1,
  1680. 'session.name': 'PHPSESSID',
  1681. 'session.auto_start': 0,
  1682. 'session.cookie_lifetime': 0,
  1683. 'session.cookie_path': '/',
  1684. 'session.serialize_handler': 'php',
  1685. 'session.gc_probability': 0,
  1686. 'session.gc_divisor': 1000,
  1687. 'session.gc_maxlifetime': 1440,
  1688. 'session.bug_compat_42': 'Off',
  1689. 'session.bug_compat_warn': 'Off',
  1690. 'session.cache_limiter': 'nocache',
  1691. 'session.cache_expire': '180',
  1692. 'session.use_trans_sid': 0,
  1693. 'session.hash_function': 0,
  1694. 'session.hash_bits_per_character': 5,
  1695. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1696. },
  1697. 'MSSQL': {
  1698. 'mssql.allow_persistent': 'On',
  1699. 'mssql.max_persistent': -1,
  1700. 'mssql.max_links': -1,
  1701. 'mssql.min_error_severity': 10,
  1702. 'mssql.min_message_severity': 10,
  1703. 'mssql.compatibility_mode': 'Off',
  1704. 'mssql.secure_connection': 'Off'
  1705. },
  1706. 'Tidy': {
  1707. 'tidy.clean_output': 'Off'
  1708. },
  1709. 'soap': {
  1710. 'soap.wsdl_cache_enabled': 1,
  1711. 'soap.wsdl_cache_dir': '"/tmp"',
  1712. 'soap.wsdl_cache_ttl': 86400,
  1713. 'soap.wsdl_cache_limit': 5
  1714. },
  1715. 'ldap': {
  1716. 'ldap.max_links': -1
  1717. },
  1718. },
  1719. },
  1720. }, merge=True) %}
  1721. {%- else %}
  1722. {%- set php = salt['pillar.get']('php:ng', {
  1723. 'lookup': salt['grains.filter_by']({
  1724. 'Debian': {
  1725. 'pkgs': {
  1726. 'adodb': 'php5-adodb',
  1727. 'apache2': 'libapache2-mod-php5',
  1728. 'apc': 'php-apc',
  1729. 'apcu': 'php5-apcu',
  1730. 'bcmath': 'php5',
  1731. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
  1732. 'cache-lite': 'php-cache-lite',
  1733. 'cgi': 'php5-cgi',
  1734. 'cli': 'php5-cli',
  1735. 'console-table': 'php-console-table',
  1736. 'composer_bin': 'composer',
  1737. 'curl': 'php5-curl',
  1738. 'dev': ['php5-dev','build-essential'],
  1739. 'ext_conf_path': '/etc/php5/mods-available',
  1740. 'fpm': 'php5-fpm',
  1741. 'gd': 'php5-gd',
  1742. 'gearman': 'php5-gearman',
  1743. 'geoip': 'php5-geoip',
  1744. 'geshi': 'php-geshi',
  1745. 'gettext': 'php-gettext',
  1746. 'gmp': 'php5-gmp',
  1747. 'hhvm': 'hhvm',
  1748. 'imagick': 'php5-imagick',
  1749. 'imap': 'php5-imap',
  1750. 'intl': 'php5-intl',
  1751. 'json': 'php5-json',
  1752. 'ldap': 'php5-ldap',
  1753. 'local_bin': '/usr/local/bin',
  1754. 'mbstring': 'php5',
  1755. 'mcrypt': 'php5-mcrypt',
  1756. 'mdb2': 'php-mdb2',
  1757. 'mdb2-driver-mysql': 'php-mdb2-driver-mysql',
  1758. 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql',
  1759. 'memcache': 'php5-memcache',
  1760. 'memcached': 'php5-memcached',
  1761. 'mysql': 'php5-mysql',
  1762. 'mysqlnd': 'php5-mysqlnd',
  1763. 'net4': 'php-net-ipv4',
  1764. 'net6': 'php-net-ipv6',
  1765. 'oauth': 'php5-oauth',
  1766. 'opcache': 'php5',
  1767. 'pear': 'php-pear',
  1768. 'pgsql': 'php5-pgsql',
  1769. 'php': 'php5',
  1770. 'phpenmod_command': 'php5enmod',
  1771. 'pspell': 'php5-pspell',
  1772. 'redis': 'php5-redis',
  1773. 'seclib': 'php-seclib',
  1774. 'snmp': 'php5-snmp',
  1775. 'soap': 'php-soap',
  1776. 'sqlite': 'php5-sqlite',
  1777. 'ssh2': 'php5-ssh2',
  1778. 'suhosin5_ext': 'suhosin.so',
  1779. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1780. 'suhosin7_ext': 'suhosin7.so',
  1781. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1782. 'svn': 'php5-svn',
  1783. 'tcpdf': 'php-tcpdf',
  1784. 'temp_dir': '/tmp',
  1785. 'tidy': 'php5-tidy',
  1786. 'uuid': 'php-uuid',
  1787. 'xcache': 'php5-xcache',
  1788. 'xdebug': 'php5-xdebug',
  1789. 'xml': 'php5',
  1790. 'xsl': 'php5-xsl',
  1791. 'zip': 'php5',
  1792. },
  1793. 'fpm': {
  1794. 'conf': '/etc/php5/fpm/php-fpm.conf',
  1795. 'ini': '/etc/php5/fpm/php.ini',
  1796. 'pools': '/etc/php5/fpm/pool.d',
  1797. 'service': 'php5-fpm',
  1798. 'defaults': odict([
  1799. ('global', odict([
  1800. ('pid', '/var/run/php5-fpm.pid'),
  1801. ('error_log', '/var/log/php5-fpm.log'),
  1802. ])),
  1803. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  1804. ]),
  1805. },
  1806. 'hhvm': {
  1807. 'conf': '/etc/hhvm/server.ini',
  1808. 'ini': '/etc/hhvm/php.ini',
  1809. 'service': 'hhvm',
  1810. 'defaults': {},
  1811. 'server': odict([
  1812. ('pid', '/var/run/hhvm/pid'),
  1813. ('hhvm.server.port', '9000'),
  1814. ('hhvm.server.type', 'fastcgi'),
  1815. ('hhvm.server.default_document', 'index.php'),
  1816. ('hhvm.log.use_log_file', 'true'),
  1817. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1818. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1819. ]),
  1820. 'php': odict([
  1821. ('session.save_handler', 'files'),
  1822. ('session.save_path', '/var/lib/hhvm/sessions'),
  1823. ('session.gc_maxlifetime', '1440'),
  1824. ('hhvm.log.level', 'Warning'),
  1825. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1826. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1827. ('hhvm.mysql.typed_results', 'false'),
  1828. ]),
  1829. },
  1830. 'cli': {
  1831. 'ini': '/etc/php5/cli/php.ini',
  1832. },
  1833. 'apache2': {
  1834. 'ini': '/etc/php5/apache2/php.ini',
  1835. },
  1836. 'xcache': {
  1837. 'ini': '/etc/php5/mods-available/xcache.ini',
  1838. 'defaults': {},
  1839. },
  1840. },
  1841. 'RedHat': {
  1842. 'pkgs': {
  1843. 'adodb': 'php-adodb',
  1844. 'apc': 'php-pecl-apc',
  1845. 'apcu': 'php-pecl-apcu',
  1846. 'bcmath': 'php-bcmath',
  1847. 'build_pkgs': ['openssl-devel', 'gcc'],
  1848. 'cache-lite': 'php-pear-Cache-Lite',
  1849. 'cgi': 'php-cgi',
  1850. 'cli': 'php-cli',
  1851. 'composer': 'composer',
  1852. 'composer_bin': 'composer',
  1853. 'console-table': 'php-pear-Console-Table',
  1854. 'curl': ['php-common', 'curl'],
  1855. 'dev': 'php-devel',
  1856. 'ext_conf_path': '/etc/php.d',
  1857. 'fpm': 'php-fpm',
  1858. 'gd': 'php-gd',
  1859. 'geoip': 'php-pecl-geoip',
  1860. 'geshi': 'php-geshi',
  1861. 'gettext': 'php-php-gettext',
  1862. 'imagick': 'php-pecl-imagick',
  1863. 'imap': 'php-imap',
  1864. 'intl': 'php-intl',
  1865. 'json': 'php-common',
  1866. 'ldap': 'php-ldap',
  1867. 'local_bin': '/usr/local/bin',
  1868. 'mbstring': 'php-mbstring',
  1869. 'mcrypt': 'php-mcrypt',
  1870. 'memcache': 'php-pecl-memcache',
  1871. 'memcached': 'php-pecl-memcached',
  1872. 'mysql': 'php-mysql',
  1873. 'mysqlnd': 'php-mysqlnd',
  1874. 'net4': 'php-pear-Net-IPv4',
  1875. 'oauth': 'php-pecl-oauth',
  1876. 'opcache': 'php-pecl-zendopcache',
  1877. 'pear': 'php-pear',
  1878. 'pgsql': 'php-pgsql',
  1879. 'php': 'php',
  1880. 'pspell': 'php-pspell',
  1881. 'redis': 'php-pecl-redis',
  1882. 'seclib': 'php-phpseclib',
  1883. 'snmp': 'php-snmp',
  1884. 'soap': 'php-soap',
  1885. 'sqlite': 'php-pdo',
  1886. 'ssh2': 'php-pecl-ssh2',
  1887. 'suhosin5_ext': 'suhosin.so',
  1888. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1889. 'suhosin7_ext': 'suhosin7.so',
  1890. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1891. 'tcpdf': 'php-tcpdf',
  1892. 'temp_dir': '/tmp',
  1893. 'tidy': 'php-tidy',
  1894. 'uuid': 'php-pecl-uuid',
  1895. 'xcache': 'php-xcache',
  1896. 'xdebug': 'php-pecl-xdebug',
  1897. 'xml': 'php-xml',
  1898. 'xsl': 'php-xml',
  1899. 'zip': 'php',
  1900. },
  1901. 'fpm': {
  1902. 'conf': '/etc/php-fpm.conf',
  1903. 'ini': '/etc/php.ini',
  1904. 'pools': '/etc/php-fpm.d',
  1905. 'service': 'php-fpm',
  1906. 'defaults': {
  1907. 'global': {
  1908. 'pid': '/var/run/php-fpm/php-fpm.pid',
  1909. 'error_log': '/var/log/php-fpm/error.log',
  1910. },
  1911. 'include': '/etc/php-fpm.d/*.conf',
  1912. },
  1913. },
  1914. 'cli': {
  1915. 'ini': '/etc/php.ini',
  1916. },
  1917. 'xcache': {
  1918. 'ini': '/etc/php.d/xcache.ini',
  1919. },
  1920. },
  1921. 'Suse': {
  1922. 'pkgs': {
  1923. 'adodb': 'php5-dba',
  1924. 'apache2': 'apache2-mod_php5',
  1925. 'cli': 'php5',
  1926. 'curl': 'php5-curl',
  1927. 'fpm': 'php5-fpm',
  1928. 'gd': 'php5-gd',
  1929. 'imap': 'php5-imap',
  1930. 'intl': 'php5-intl',
  1931. 'json': 'php5-json',
  1932. 'ldap': 'php5-ldap',
  1933. 'mbstring': 'php5-mbstring',
  1934. 'mcrypt': 'php5-mcrypt',
  1935. 'mysql': 'php5-mysql',
  1936. 'oauth': 'php5-oauth',
  1937. 'pear': 'php5-pear',
  1938. 'pgsql': 'php5-pgsql',
  1939. 'php': 'php5',
  1940. 'snmp': 'php5-snmp',
  1941. 'soap': 'php5-soap',
  1942. 'sqlite': 'php5-sqlite',
  1943. 'suhosin': 'php5-suhosin',
  1944. 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'],
  1945. 'zip': 'php5-zip',
  1946. },
  1947. 'fpm': {
  1948. 'conf': '/etc/php-fpm.conf',
  1949. 'ini': '/etc/php.ini',
  1950. 'pools': '/etc/php-fpm.d',
  1951. 'service': 'php-fpm',
  1952. 'defaults': {
  1953. 'global': {
  1954. 'pid': '/var/run/php-fpm/php-fpm.pid',
  1955. 'error_log': '/var/log/php-fpm/error.log',
  1956. },
  1957. 'include': '/etc/php-fpm.d/*.conf',
  1958. },
  1959. },
  1960. 'cli': {
  1961. 'ini': '/etc/php.ini',
  1962. },
  1963. },
  1964. 'Arch': {
  1965. 'pkgs': {
  1966. 'apc': 'php-apcu',
  1967. 'apcu': 'php-apcu-bc',
  1968. 'cgi': 'php-cgi',
  1969. 'cli': 'php',
  1970. 'composer_bin': 'composer',
  1971. 'curl': 'curl',
  1972. 'fpm': 'php-fpm',
  1973. 'gd': 'php-gd',
  1974. 'geoip': 'php-geoip',
  1975. 'imap': 'php-imap',
  1976. 'intl': 'php-intl',
  1977. 'local_bin': '/usr/local/bin',
  1978. 'mcrypt': 'php-mcrypt',
  1979. 'memcache': 'php-memcache',
  1980. 'memcached': 'php-memcached',
  1981. 'pgsql': 'php-pgsql',
  1982. 'php': 'php',
  1983. 'pspell': 'php-pspell',
  1984. 'snmp': 'php-snmp',
  1985. 'sqlite': 'php-sqlite',
  1986. 'temp_dir': '/tmp',
  1987. 'tidy': 'php-tidy',
  1988. 'xcache': 'php-xcache',
  1989. 'xdebug': 'xdebug',
  1990. 'xsl': 'php-xsl',
  1991. },
  1992. 'fpm': {
  1993. 'conf': '/etc/php/php-fpm.conf',
  1994. 'ini': '/etc/php/php.ini',
  1995. 'pools': '/etc/php/fpm.d',
  1996. 'service': 'php-fpm',
  1997. 'defaults': {
  1998. 'global': {
  1999. 'pid': '/run/php-fpm/php-fpm.pid',
  2000. 'error_log': 'log/php-fpm.log',
  2001. },
  2002. 'include': '/etc/php/fpm.d/*.conf',
  2003. },
  2004. },
  2005. 'cli': {
  2006. 'ini': '/etc/php/php-cli.ini',
  2007. },
  2008. 'xcache': {
  2009. 'ini': '/etc/php/conf.d/xcache.ini',
  2010. },
  2011. },
  2012. }),
  2013. 'fpm': {
  2014. 'service': {
  2015. 'enabled': True,
  2016. 'opts': {},
  2017. },
  2018. 'config': {
  2019. 'ini': {
  2020. 'opts': {},
  2021. 'settings': {},
  2022. },
  2023. 'conf': {
  2024. 'opts': {},
  2025. 'settings': {},
  2026. },
  2027. },
  2028. 'pools': {
  2029. 'default.conf': {
  2030. 'enabled': False,
  2031. 'opts': {},
  2032. },
  2033. },
  2034. },
  2035. 'hhvm': {
  2036. 'service': {
  2037. 'enabled': True,
  2038. 'opts': {},
  2039. },
  2040. 'config': {
  2041. 'server': {
  2042. 'opts': {},
  2043. 'settings': {},
  2044. },
  2045. 'php': {
  2046. 'opts': {},
  2047. 'settings': {},
  2048. },
  2049. },
  2050. },
  2051. 'cli': {
  2052. 'ini': {
  2053. 'opts': {},
  2054. 'settings': {},
  2055. }
  2056. },
  2057. 'apache2': {
  2058. 'ini': {
  2059. 'opts': {},
  2060. 'settings': {},
  2061. }
  2062. },
  2063. 'xcache': {
  2064. 'ini': {
  2065. 'defaults': {
  2066. 'xcache-common': {
  2067. 'extension': 'xcache.so',
  2068. },
  2069. 'xcache.admin': {
  2070. 'xcache.admin.enable_auth': 'On',
  2071. },
  2072. 'xcache': {
  2073. 'xcache.shm_scheme': '"mmap"',
  2074. 'xcache.size': '60M',
  2075. 'xcache.count': '1',
  2076. 'xcache.slots': '8K',
  2077. 'xcache.ttl': '0',
  2078. 'xcache.gc_interval': '0',
  2079. 'xcache.var_size': '4M',
  2080. 'xcache.var_count': '1',
  2081. 'xcache.var_slots': '8K',
  2082. 'xcache.var_ttl': '0',
  2083. 'xcache.var_maxttl': '0',
  2084. 'xcache.var_gc_interval': '300',
  2085. 'xcache.var_namespace_mode': '0',
  2086. 'xcache.var_namespace': '""',
  2087. 'xcache.readonly_protection': 'Off',
  2088. 'xcache.mmap_path': '"/dev/zero"',
  2089. 'xcache.coredump_directory': '""',
  2090. 'xcache.coredump_type': '0',
  2091. 'xcache.disable_on_crash': 'Off',
  2092. 'xcache.experimental': 'Off',
  2093. 'xcache.cacher': 'On',
  2094. 'xcache.stat': 'On',
  2095. 'xcache.optimizer': 'Off',
  2096. },
  2097. 'xcache.coverager': {
  2098. 'xcache.coverager': 'Off',
  2099. 'xcache.coverager_autostart': 'On',
  2100. 'xcache.coveragedump_directory': '""',
  2101. },
  2102. },
  2103. 'opts': {},
  2104. 'settings': {},
  2105. }
  2106. },
  2107. 'ini': {
  2108. 'defaults': {
  2109. 'PHP': {
  2110. 'engine': 'On',
  2111. 'allow_url_fopen': 'On',
  2112. 'allow_url_include': 'Off',
  2113. 'asp_tags': 'Off',
  2114. 'auto_globals_jit': 'On',
  2115. 'default_mimetype': '"text/html"',
  2116. 'default_socket_timeout': 60,
  2117. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  2118. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  2119. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  2120. 'display_errors': 'Off',
  2121. 'display_startup_errors': 'Off',
  2122. 'enable_dl': 'Off',
  2123. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  2124. 'expose_php': 'On',
  2125. 'file_uploads': 'On',
  2126. 'html_errors': 'On',
  2127. 'ignore_repeated_errors': 'Off',
  2128. 'ignore_repeated_source': 'Off',
  2129. 'implicit_flush': 'Off',
  2130. 'log_errors': 'On',
  2131. 'log_errors_max_len': 1024,
  2132. 'max_execution_time': 30,
  2133. 'max_file_uploads': 20,
  2134. 'max_input_nesting_level': 64,
  2135. 'max_input_time': 60,
  2136. 'max_input_vars': 1000,
  2137. 'memory_limit': '128M',
  2138. 'output_buffering': 4096,
  2139. 'post_max_size': '8M',
  2140. 'precision': 14,
  2141. 'register_argc_argv': 'Off',
  2142. 'report_memleaks': 'On',
  2143. 'request_order': 'GP',
  2144. 'serialize_precision': 17,
  2145. 'short_open_tag': 'Off',
  2146. 'track_errors': 'Off',
  2147. 'upload_max_filesize': '2M',
  2148. 'variables_order': 'GPCS',
  2149. 'zend.enable_gc': 'On',
  2150. 'zlib.output_compression': 'Off',
  2151. },
  2152. 'CLI Server': {
  2153. 'cli_server.color': 'On'
  2154. },
  2155. 'Date': {
  2156. 'date.timezone': 'America/New_York'
  2157. },
  2158. 'Pdo_mysql': {
  2159. 'pdo_mysql.cache_size': 2000
  2160. },
  2161. 'mail function': {
  2162. 'SMTP': 'localhost',
  2163. 'mail.add_x_header': 'On'
  2164. },
  2165. 'SQL': {
  2166. 'sql.safe_mode': 'Off'
  2167. },
  2168. 'ODBC': {
  2169. 'odbc.allow_persistent': 'On',
  2170. 'odbc.check_persistent': 'On',
  2171. 'odbc.max_persistent': '-1',
  2172. 'odbc.max_links': '-1',
  2173. 'odbc.defaultlrl': 4096,
  2174. 'odbc.defaultbinmode': 1
  2175. },
  2176. 'Interbase': {
  2177. 'ibase.allow_persistent': 1,
  2178. 'ibase.max_persistent': -1,
  2179. 'ibase.max_links': -1,
  2180. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  2181. 'ibase.dateformat': '"%Y-%m-%d"',
  2182. 'ibase.timeformat': '"%H:%M:%S"'
  2183. },
  2184. 'MySQL': {
  2185. 'mysql.allow_local_infile': 'On',
  2186. 'mysql.allow_persistent': 'On',
  2187. 'mysql.cache_size': '2000',
  2188. 'mysql.max_persistent': -1,
  2189. 'mysql.max_links': -1,
  2190. 'mysql.connect_timeout': 60,
  2191. 'mysql.trace_mode': 'Off'
  2192. },
  2193. 'MySQLi': {
  2194. 'mysqli.max_persistent': -1,
  2195. 'mysqli.allow_persistent': 'On',
  2196. 'mysqli.max_links': -1,
  2197. 'mysqli.cache_size': 2000,
  2198. 'mysqli.default_port': 3306,
  2199. 'mysqli.reconnect': 'Off'
  2200. },
  2201. 'mysqlnd': {
  2202. 'mysqlnd.collect_statistics': 'On',
  2203. 'mysqlnd.collect_memory_statistics': 'Off'
  2204. },
  2205. 'PostgreSQL': {
  2206. 'pgsql.allow_persistent': 'On',
  2207. 'pgsql.auto_reset_persistent': 'Off',
  2208. 'pgsql.max_persistent': -1,
  2209. 'pgsql.max_links': -1,
  2210. 'pgsql.ignore_notice': 0,
  2211. 'pgsql.log_notice': 0
  2212. },
  2213. 'Sybase-CT': {
  2214. 'sybct.allow_persistent': 'On',
  2215. 'sybct.max_persistent': -1,
  2216. 'sybct.max_links': -1,
  2217. 'sybct.min_server_severity': 10,
  2218. 'sybct.min_client_severity': 10
  2219. },
  2220. 'bcmath': {
  2221. 'bcmath.scale': 0
  2222. },
  2223. 'Session': {
  2224. 'session.save_handler': 'files',
  2225. 'session.use_strict_mode': 0,
  2226. 'session.use_cookies': 1,
  2227. 'session.use_only_cookies': 1,
  2228. 'session.name': 'PHPSESSID',
  2229. 'session.auto_start': 0,
  2230. 'session.cookie_lifetime': 0,
  2231. 'session.cookie_path': '/',
  2232. 'session.serialize_handler': 'php',
  2233. 'session.gc_probability': 0,
  2234. 'session.gc_divisor': 1000,
  2235. 'session.gc_maxlifetime': 1440,
  2236. 'session.bug_compat_42': 'Off',
  2237. 'session.bug_compat_warn': 'Off',
  2238. 'session.cache_limiter': 'nocache',
  2239. 'session.cache_expire': '180',
  2240. 'session.use_trans_sid': 0,
  2241. 'session.hash_function': 0,
  2242. 'session.hash_bits_per_character': 5,
  2243. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  2244. },
  2245. 'MSSQL': {
  2246. 'mssql.allow_persistent': 'On',
  2247. 'mssql.max_persistent': -1,
  2248. 'mssql.max_links': -1,
  2249. 'mssql.min_error_severity': 10,
  2250. 'mssql.min_message_severity': 10,
  2251. 'mssql.compatibility_mode': 'Off',
  2252. 'mssql.secure_connection': 'Off'
  2253. },
  2254. 'Tidy': {
  2255. 'tidy.clean_output': 'Off'
  2256. },
  2257. 'soap': {
  2258. 'soap.wsdl_cache_enabled': 1,
  2259. 'soap.wsdl_cache_dir': '"/tmp"',
  2260. 'soap.wsdl_cache_ttl': 86400,
  2261. 'soap.wsdl_cache_limit': 5
  2262. },
  2263. 'ldap': {
  2264. 'ldap.max_links': -1
  2265. },
  2266. },
  2267. },
  2268. }, merge=True) %}
  2269. {%- endif %}