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.

2274 lines
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. {%- if phpng_version|string == '5' %}
  1403. {%- set confdir = '/etc/php5' %}
  1404. {%- else %}
  1405. {%- set confdir = '/etc/php/' + phpng_version %}
  1406. {%- endif %}
  1407. {%- set php = salt['pillar.get']('php:ng', {
  1408. 'lookup': salt['grains.filter_by']({
  1409. 'Debian': {
  1410. 'pkgs': {
  1411. 'adodb': 'libphp-adodb',
  1412. 'apache2': 'libapache2-mod-php' + phpng_version,
  1413. 'apc': 'php-apcu',
  1414. 'apcu': 'php-apcu-bc',
  1415. 'bcmath': 'php' + phpng_version + '-bcmath',
  1416. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  1417. 'cache-lite': 'php-cache-lite',
  1418. 'cgi': 'php' + phpng_version + '-cgi',
  1419. 'cli': 'php' + phpng_version + '-cli',
  1420. 'composer_bin': 'composer',
  1421. 'console-table': 'php-console-table',
  1422. 'curl': 'php' + phpng_version + '-curl',
  1423. 'dev': 'php' + phpng_version + '-dev',
  1424. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  1425. 'fpm': 'php' + phpng_version + '-fpm',
  1426. 'gd': 'php' + phpng_version + '-gd',
  1427. 'gearman': 'php-gearman',
  1428. 'geoip': 'php-geoip',
  1429. 'geshi': 'php-geshi',
  1430. 'gettext': 'php' + phpng_version,
  1431. 'gmp': 'php' + phpng_version + '-gmp',
  1432. 'hhvm': 'hhvm',
  1433. 'imagick': 'php-imagick',
  1434. 'imap': 'php' + phpng_version + '-imap',
  1435. 'intl': 'php' + phpng_version + '-intl',
  1436. 'json': 'php' + phpng_version + '-json',
  1437. 'ldap': 'php' + phpng_version + '-ldap',
  1438. 'local_bin': '/usr/local/bin',
  1439. 'mbstring': 'php' + phpng_version + '-mbstring',
  1440. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  1441. 'memcache': 'php-memcache',
  1442. 'memcached': 'php-memcached',
  1443. 'mongo': 'php-mongo',
  1444. 'mongodb': 'php-mongodb',
  1445. 'mysql': 'php' + phpng_version + '-mysql',
  1446. 'mysqlnd': 'php' + phpng_version + '-mysql',
  1447. 'net4': 'php-net-ipv4',
  1448. 'net6': 'php-net-ipv6',
  1449. 'oauth': 'php-oauth',
  1450. 'opcache': 'php' + phpng_version + '-opcache',
  1451. 'pear': 'php-pear',
  1452. 'pgsql': 'php' + phpng_version + '-pgsql',
  1453. 'php': 'php' + phpng_version,
  1454. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  1455. 'pspell': 'php' + phpng_version + '-pspell',
  1456. 'redis': 'php-redis',
  1457. 'seclib': ['php-phpseclib', 'php-seclib'],
  1458. 'snmp': 'php' + phpng_version + '-snmp',
  1459. 'soap': 'php' + phpng_version + '-soap',
  1460. 'ssh2': 'php-ssh2',
  1461. 'sqlite': 'php' + phpng_version + '-sqlite3',
  1462. 'suhosin5_ext': 'suhosin.so',
  1463. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1464. 'suhosin7_ext': 'suhosin7.so',
  1465. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1466. 'tcpdf': 'php-tcpdf',
  1467. 'temp_dir': '/tmp',
  1468. 'tidy': 'php' + phpng_version + '-tidy',
  1469. 'xdebug': 'php' + phpng_version + '-xdebug',
  1470. 'xml': 'php' + phpng_version + '-xml',
  1471. 'xsl': 'php' + phpng_version + '-xsl',
  1472. 'zip': 'php' + phpng_version + '-zip',
  1473. },
  1474. 'fpm': {
  1475. 'conf': confdir + '/fpm/php-fpm.conf',
  1476. 'ini': confdir + '/fpm/php.ini',
  1477. 'pools': confdir + '/fpm/pool.d',
  1478. 'service': 'php' + phpng_version + '-fpm',
  1479. 'defaults': odict([
  1480. ('global', odict([
  1481. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  1482. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  1483. ])),
  1484. ('include', confdir + '/fpm/pool.d/*.conf'),
  1485. ]),
  1486. },
  1487. 'hhvm': {
  1488. 'conf': '/etc/hhvm/server.ini',
  1489. 'ini': '/etc/hhvm/php.ini',
  1490. 'service': 'hhvm',
  1491. 'defaults': {},
  1492. 'server': odict([
  1493. ('pid', '/var/run/hhvm/pid'),
  1494. ('hhvm.server.port', '9000'),
  1495. ('hhvm.server.type', 'fastcgi'),
  1496. ('hhvm.server.default_document', 'index.php'),
  1497. ('hhvm.log.use_log_file', 'true'),
  1498. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1499. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1500. ]),
  1501. 'php': odict([
  1502. ('session.save_handler', 'files'),
  1503. ('session.save_path', '/var/lib/hhvm/sessions'),
  1504. ('session.gc_maxlifetime', '1440'),
  1505. ('hhvm.log.level', 'Warning'),
  1506. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1507. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1508. ('hhvm.mysql.typed_results', 'false'),
  1509. ]),
  1510. },
  1511. 'cli': {
  1512. 'ini': confdir + '/cli/php.ini',
  1513. },
  1514. 'apache2': {
  1515. 'ini': confdir + '/apache2/php.ini',
  1516. },
  1517. },
  1518. }),
  1519. 'fpm': {
  1520. 'service': {
  1521. 'enabled': True,
  1522. 'opts': {},
  1523. },
  1524. 'config': {
  1525. 'ini': {
  1526. 'opts': {},
  1527. 'settings': {},
  1528. },
  1529. 'conf': {
  1530. 'opts': {},
  1531. 'settings': {},
  1532. },
  1533. },
  1534. 'pools': {},
  1535. },
  1536. 'hhvm': {
  1537. 'service': {
  1538. 'enabled': True,
  1539. 'opts': {},
  1540. },
  1541. 'config': {
  1542. 'server': {
  1543. 'opts': {},
  1544. 'settings': {},
  1545. },
  1546. 'php': {
  1547. 'opts': {},
  1548. 'settings': {},
  1549. },
  1550. },
  1551. },
  1552. 'cli': {
  1553. 'ini': {
  1554. 'opts': {},
  1555. 'settings': {},
  1556. }
  1557. },
  1558. 'apache2': {
  1559. 'ini': {
  1560. 'opts': {},
  1561. 'settings': {},
  1562. }
  1563. },
  1564. 'ini': {
  1565. 'defaults': {
  1566. 'PHP': {
  1567. 'allow_url_fopen': 'On',
  1568. 'allow_url_include': 'Off',
  1569. 'asp_tags': 'Off',
  1570. 'auto_globals_jit': 'On',
  1571. 'default_mimetype': '"text/html"',
  1572. 'default_socket_timeout': 60,
  1573. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  1574. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  1575. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  1576. 'display_errors': 'Off',
  1577. 'display_startup_errors': 'Off',
  1578. 'enable_dl': 'Off',
  1579. 'engine': 'On',
  1580. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  1581. 'expose_php': 'On',
  1582. 'file_uploads': 'On',
  1583. 'html_errors': 'On',
  1584. 'ignore_repeated_errors': 'Off',
  1585. 'ignore_repeated_source': 'Off',
  1586. 'implicit_flush': 'Off',
  1587. 'log_errors': 'On',
  1588. 'log_errors_max_len': 1024,
  1589. 'max_execution_time': 30,
  1590. 'max_file_uploads': 20,
  1591. 'max_input_nesting_level': 64,
  1592. 'max_input_time': 60,
  1593. 'max_input_vars': 1000,
  1594. 'memory_limit': '128M',
  1595. 'output_buffering': 4096,
  1596. 'post_max_size': '8M',
  1597. 'precision': 14,
  1598. 'register_argc_argv': 'Off',
  1599. 'report_memleaks': 'On',
  1600. 'request_order': 'GP',
  1601. 'serialize_precision': 17,
  1602. 'short_open_tag': 'Off',
  1603. 'track_errors': 'Off',
  1604. 'upload_max_filesize': '2M',
  1605. 'variables_order': 'GPCS',
  1606. 'zend.enable_gc': 'On',
  1607. 'zlib.output_compression': 'Off',
  1608. },
  1609. 'CLI Server': {
  1610. 'cli_server.color': 'On'
  1611. },
  1612. 'Date': {
  1613. 'date.timezone': 'America/New_York'
  1614. },
  1615. 'Pdo_mysql': {
  1616. 'pdo_mysql.cache_size': 2000
  1617. },
  1618. 'mail function': {
  1619. 'SMTP': 'localhost',
  1620. 'mail.add_x_header': 'On'
  1621. },
  1622. 'SQL': {
  1623. 'sql.safe_mode': 'Off'
  1624. },
  1625. 'ODBC': {
  1626. 'odbc.allow_persistent': 'On',
  1627. 'odbc.check_persistent': 'On',
  1628. 'odbc.max_persistent': '-1',
  1629. 'odbc.max_links': '-1',
  1630. 'odbc.defaultlrl': 4096,
  1631. 'odbc.defaultbinmode': 1
  1632. },
  1633. 'Interbase': {
  1634. 'ibase.allow_persistent': 1,
  1635. 'ibase.max_persistent': -1,
  1636. 'ibase.max_links': -1,
  1637. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  1638. 'ibase.dateformat': '"%Y-%m-%d"',
  1639. 'ibase.timeformat': '"%H:%M:%S"'
  1640. },
  1641. 'MySQL': {
  1642. 'mysql.allow_local_infile': 'On',
  1643. 'mysql.allow_persistent': 'On',
  1644. 'mysql.cache_size': '2000',
  1645. 'mysql.max_persistent': -1,
  1646. 'mysql.max_links': -1,
  1647. 'mysql.connect_timeout': 60,
  1648. 'mysql.trace_mode': 'Off'
  1649. },
  1650. 'MySQLi': {
  1651. 'mysqli.max_persistent': -1,
  1652. 'mysqli.allow_persistent': 'On',
  1653. 'mysqli.max_links': -1,
  1654. 'mysqli.cache_size': 2000,
  1655. 'mysqli.default_port': 3306,
  1656. 'mysqli.reconnect': 'Off'
  1657. },
  1658. 'mysqlnd': {
  1659. 'mysqlnd.collect_statistics': 'On',
  1660. 'mysqlnd.collect_memory_statistics': 'Off'
  1661. },
  1662. 'PostgreSQL': {
  1663. 'pgsql.allow_persistent': 'On',
  1664. 'pgsql.auto_reset_persistent': 'Off',
  1665. 'pgsql.max_persistent': -1,
  1666. 'pgsql.max_links': -1,
  1667. 'pgsql.ignore_notice': 0,
  1668. 'pgsql.log_notice': 0
  1669. },
  1670. 'Sybase-CT': {
  1671. 'sybct.allow_persistent': 'On',
  1672. 'sybct.max_persistent': -1,
  1673. 'sybct.max_links': -1,
  1674. 'sybct.min_server_severity': 10,
  1675. 'sybct.min_client_severity': 10
  1676. },
  1677. 'bcmath': {
  1678. 'bcmath.scale': 0
  1679. },
  1680. 'Session': {
  1681. 'session.save_handler': 'files',
  1682. 'session.use_strict_mode': 0,
  1683. 'session.use_cookies': 1,
  1684. 'session.use_only_cookies': 1,
  1685. 'session.name': 'PHPSESSID',
  1686. 'session.auto_start': 0,
  1687. 'session.cookie_lifetime': 0,
  1688. 'session.cookie_path': '/',
  1689. 'session.serialize_handler': 'php',
  1690. 'session.gc_probability': 0,
  1691. 'session.gc_divisor': 1000,
  1692. 'session.gc_maxlifetime': 1440,
  1693. 'session.bug_compat_42': 'Off',
  1694. 'session.bug_compat_warn': 'Off',
  1695. 'session.cache_limiter': 'nocache',
  1696. 'session.cache_expire': '180',
  1697. 'session.use_trans_sid': 0,
  1698. 'session.hash_function': 0,
  1699. 'session.hash_bits_per_character': 5,
  1700. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1701. },
  1702. 'MSSQL': {
  1703. 'mssql.allow_persistent': 'On',
  1704. 'mssql.max_persistent': -1,
  1705. 'mssql.max_links': -1,
  1706. 'mssql.min_error_severity': 10,
  1707. 'mssql.min_message_severity': 10,
  1708. 'mssql.compatibility_mode': 'Off',
  1709. 'mssql.secure_connection': 'Off'
  1710. },
  1711. 'Tidy': {
  1712. 'tidy.clean_output': 'Off'
  1713. },
  1714. 'soap': {
  1715. 'soap.wsdl_cache_enabled': 1,
  1716. 'soap.wsdl_cache_dir': '"/tmp"',
  1717. 'soap.wsdl_cache_ttl': 86400,
  1718. 'soap.wsdl_cache_limit': 5
  1719. },
  1720. 'ldap': {
  1721. 'ldap.max_links': -1
  1722. },
  1723. },
  1724. },
  1725. }, merge=True) %}
  1726. {%- else %}
  1727. {%- set php = salt['pillar.get']('php:ng', {
  1728. 'lookup': salt['grains.filter_by']({
  1729. 'Debian': {
  1730. 'pkgs': {
  1731. 'adodb': 'php5-adodb',
  1732. 'apache2': 'libapache2-mod-php5',
  1733. 'apc': 'php-apc',
  1734. 'apcu': 'php5-apcu',
  1735. 'bcmath': 'php5',
  1736. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
  1737. 'cache-lite': 'php-cache-lite',
  1738. 'cgi': 'php5-cgi',
  1739. 'cli': 'php5-cli',
  1740. 'console-table': 'php-console-table',
  1741. 'composer_bin': 'composer',
  1742. 'curl': 'php5-curl',
  1743. 'dev': ['php5-dev','build-essential'],
  1744. 'ext_conf_path': '/etc/php5/mods-available',
  1745. 'fpm': 'php5-fpm',
  1746. 'gd': 'php5-gd',
  1747. 'gearman': 'php5-gearman',
  1748. 'geoip': 'php5-geoip',
  1749. 'geshi': 'php-geshi',
  1750. 'gettext': 'php-gettext',
  1751. 'gmp': 'php5-gmp',
  1752. 'hhvm': 'hhvm',
  1753. 'imagick': 'php5-imagick',
  1754. 'imap': 'php5-imap',
  1755. 'intl': 'php5-intl',
  1756. 'json': 'php5-json',
  1757. 'ldap': 'php5-ldap',
  1758. 'local_bin': '/usr/local/bin',
  1759. 'mbstring': 'php5',
  1760. 'mcrypt': 'php5-mcrypt',
  1761. 'mdb2': 'php-mdb2',
  1762. 'mdb2-driver-mysql': 'php-mdb2-driver-mysql',
  1763. 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql',
  1764. 'memcache': 'php5-memcache',
  1765. 'memcached': 'php5-memcached',
  1766. 'mysql': 'php5-mysql',
  1767. 'mysqlnd': 'php5-mysqlnd',
  1768. 'net4': 'php-net-ipv4',
  1769. 'net6': 'php-net-ipv6',
  1770. 'oauth': 'php5-oauth',
  1771. 'opcache': 'php5',
  1772. 'pear': 'php-pear',
  1773. 'pgsql': 'php5-pgsql',
  1774. 'php': 'php5',
  1775. 'phpenmod_command': 'php5enmod',
  1776. 'pspell': 'php5-pspell',
  1777. 'redis': 'php5-redis',
  1778. 'seclib': 'php-seclib',
  1779. 'snmp': 'php5-snmp',
  1780. 'soap': 'php-soap',
  1781. 'sqlite': 'php5-sqlite',
  1782. 'ssh2': 'php5-ssh2',
  1783. 'suhosin5_ext': 'suhosin.so',
  1784. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1785. 'suhosin7_ext': 'suhosin7.so',
  1786. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1787. 'svn': 'php5-svn',
  1788. 'tcpdf': 'php-tcpdf',
  1789. 'temp_dir': '/tmp',
  1790. 'tidy': 'php5-tidy',
  1791. 'xcache': 'php5-xcache',
  1792. 'xdebug': 'php5-xdebug',
  1793. 'xml': 'php5',
  1794. 'xsl': 'php5-xsl',
  1795. 'zip': 'php5',
  1796. },
  1797. 'fpm': {
  1798. 'conf': '/etc/php5/fpm/php-fpm.conf',
  1799. 'ini': '/etc/php5/fpm/php.ini',
  1800. 'pools': '/etc/php5/fpm/pool.d',
  1801. 'service': 'php5-fpm',
  1802. 'defaults': odict([
  1803. ('global', odict([
  1804. ('pid', '/var/run/php5-fpm.pid'),
  1805. ('error_log', '/var/log/php5-fpm.log'),
  1806. ])),
  1807. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  1808. ]),
  1809. },
  1810. 'hhvm': {
  1811. 'conf': '/etc/hhvm/server.ini',
  1812. 'ini': '/etc/hhvm/php.ini',
  1813. 'service': 'hhvm',
  1814. 'defaults': {},
  1815. 'server': odict([
  1816. ('pid', '/var/run/hhvm/pid'),
  1817. ('hhvm.server.port', '9000'),
  1818. ('hhvm.server.type', 'fastcgi'),
  1819. ('hhvm.server.default_document', 'index.php'),
  1820. ('hhvm.log.use_log_file', 'true'),
  1821. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1822. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1823. ]),
  1824. 'php': odict([
  1825. ('session.save_handler', 'files'),
  1826. ('session.save_path', '/var/lib/hhvm/sessions'),
  1827. ('session.gc_maxlifetime', '1440'),
  1828. ('hhvm.log.level', 'Warning'),
  1829. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1830. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1831. ('hhvm.mysql.typed_results', 'false'),
  1832. ]),
  1833. },
  1834. 'cli': {
  1835. 'ini': '/etc/php5/cli/php.ini',
  1836. },
  1837. 'apache2': {
  1838. 'ini': '/etc/php5/apache2/php.ini',
  1839. },
  1840. 'xcache': {
  1841. 'ini': '/etc/php5/mods-available/xcache.ini',
  1842. 'defaults': {},
  1843. },
  1844. },
  1845. 'RedHat': {
  1846. 'pkgs': {
  1847. 'adodb': 'php-adodb',
  1848. 'apc': 'php-pecl-apc',
  1849. 'apcu': 'php-pecl-apcu',
  1850. 'bcmath': 'php-bcmath',
  1851. 'build_pkgs': ['openssl-devel', 'gcc'],
  1852. 'cache-lite': 'php-pear-Cache-Lite',
  1853. 'cgi': 'php-cgi',
  1854. 'cli': 'php-cli',
  1855. 'composer': 'composer',
  1856. 'composer_bin': 'composer',
  1857. 'console-table': 'php-pear-Console-Table',
  1858. 'curl': ['php-common', 'curl'],
  1859. 'dev': 'php-devel',
  1860. 'ext_conf_path': '/etc/php.d',
  1861. 'fpm': 'php-fpm',
  1862. 'gd': 'php-gd',
  1863. 'geoip': 'php-pecl-geoip',
  1864. 'geshi': 'php-geshi',
  1865. 'gettext': 'php-php-gettext',
  1866. 'imagick': 'php-pecl-imagick',
  1867. 'imap': 'php-imap',
  1868. 'intl': 'php-intl',
  1869. 'json': 'php-common',
  1870. 'ldap': 'php-ldap',
  1871. 'local_bin': '/usr/local/bin',
  1872. 'mbstring': 'php-mbstring',
  1873. 'mcrypt': 'php-mcrypt',
  1874. 'memcache': 'php-pecl-memcache',
  1875. 'memcached': 'php-pecl-memcached',
  1876. 'mysql': 'php-mysql',
  1877. 'mysqlnd': 'php-mysqlnd',
  1878. 'net4': 'php-pear-Net-IPv4',
  1879. 'oauth': 'php-pecl-oauth',
  1880. 'opcache': 'php-pecl-zendopcache',
  1881. 'pear': 'php-pear',
  1882. 'pgsql': 'php-pgsql',
  1883. 'php': 'php',
  1884. 'pspell': 'php-pspell',
  1885. 'redis': 'php-pecl-redis',
  1886. 'seclib': 'php-phpseclib',
  1887. 'snmp': 'php-snmp',
  1888. 'soap': 'php-soap',
  1889. 'sqlite': 'php-pdo',
  1890. 'ssh2': 'php-pecl-ssh2',
  1891. 'suhosin5_ext': 'suhosin.so',
  1892. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1893. 'suhosin7_ext': 'suhosin7.so',
  1894. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1895. 'tcpdf': 'php-tcpdf',
  1896. 'temp_dir': '/tmp',
  1897. 'tidy': 'php-tidy',
  1898. 'xcache': 'php-xcache',
  1899. 'xdebug': 'php-pecl-xdebug',
  1900. 'xml': 'php-xml',
  1901. 'xsl': 'php-xml',
  1902. 'zip': 'php',
  1903. },
  1904. 'fpm': {
  1905. 'conf': '/etc/php-fpm.conf',
  1906. 'ini': '/etc/php.ini',
  1907. 'pools': '/etc/php-fpm.d',
  1908. 'service': 'php-fpm',
  1909. 'defaults': {
  1910. 'global': {
  1911. 'pid': '/var/run/php-fpm/php-fpm.pid',
  1912. 'error_log': '/var/log/php-fpm/error.log',
  1913. },
  1914. 'include': '/etc/php-fpm.d/*.conf',
  1915. },
  1916. },
  1917. 'cli': {
  1918. 'ini': '/etc/php.ini',
  1919. },
  1920. 'xcache': {
  1921. 'ini': '/etc/php.d/xcache.ini',
  1922. },
  1923. },
  1924. 'Suse': {
  1925. 'pkgs': {
  1926. 'adodb': 'php5-dba',
  1927. 'apache2': 'apache2-mod_php5',
  1928. 'cli': 'php5',
  1929. 'curl': 'php5-curl',
  1930. 'fpm': 'php5-fpm',
  1931. 'gd': 'php5-gd',
  1932. 'imap': 'php5-imap',
  1933. 'intl': 'php5-intl',
  1934. 'json': 'php5-json',
  1935. 'ldap': 'php5-ldap',
  1936. 'mbstring': 'php5-mbstring',
  1937. 'mcrypt': 'php5-mcrypt',
  1938. 'mysql': 'php5-mysql',
  1939. 'oauth': 'php5-oauth',
  1940. 'pear': 'php5-pear',
  1941. 'pgsql': 'php5-pgsql',
  1942. 'php': 'php5',
  1943. 'snmp': 'php5-snmp',
  1944. 'soap': 'php5-soap',
  1945. 'sqlite': 'php5-sqlite',
  1946. 'suhosin': 'php5-suhosin',
  1947. 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'],
  1948. 'zip': 'php5-zip',
  1949. },
  1950. 'fpm': {
  1951. 'conf': '/etc/php-fpm.conf',
  1952. 'ini': '/etc/php.ini',
  1953. 'pools': '/etc/php-fpm.d',
  1954. 'service': 'php-fpm',
  1955. 'defaults': {
  1956. 'global': {
  1957. 'pid': '/var/run/php-fpm/php-fpm.pid',
  1958. 'error_log': '/var/log/php-fpm/error.log',
  1959. },
  1960. 'include': '/etc/php-fpm.d/*.conf',
  1961. },
  1962. },
  1963. 'cli': {
  1964. 'ini': '/etc/php.ini',
  1965. },
  1966. },
  1967. 'Arch': {
  1968. 'pkgs': {
  1969. 'apc': 'php-apcu',
  1970. 'apcu': 'php-apcu-bc',
  1971. 'cgi': 'php-cgi',
  1972. 'cli': 'php',
  1973. 'composer_bin': 'composer',
  1974. 'curl': 'curl',
  1975. 'fpm': 'php-fpm',
  1976. 'gd': 'php-gd',
  1977. 'geoip': 'php-geoip',
  1978. 'imap': 'php-imap',
  1979. 'intl': 'php-intl',
  1980. 'local_bin': '/usr/local/bin',
  1981. 'mcrypt': 'php-mcrypt',
  1982. 'memcache': 'php-memcache',
  1983. 'memcached': 'php-memcached',
  1984. 'pgsql': 'php-pgsql',
  1985. 'php': 'php',
  1986. 'pspell': 'php-pspell',
  1987. 'snmp': 'php-snmp',
  1988. 'sqlite': 'php-sqlite',
  1989. 'temp_dir': '/tmp',
  1990. 'tidy': 'php-tidy',
  1991. 'xcache': 'php-xcache',
  1992. 'xdebug': 'xdebug',
  1993. 'xsl': 'php-xsl',
  1994. },
  1995. 'fpm': {
  1996. 'conf': '/etc/php/php-fpm.conf',
  1997. 'ini': '/etc/php/php.ini',
  1998. 'pools': '/etc/php/fpm.d',
  1999. 'service': 'php-fpm',
  2000. 'defaults': {
  2001. 'global': {
  2002. 'pid': '/run/php-fpm/php-fpm.pid',
  2003. 'error_log': 'log/php-fpm.log',
  2004. },
  2005. 'include': '/etc/php/fpm.d/*.conf',
  2006. },
  2007. },
  2008. 'cli': {
  2009. 'ini': '/etc/php/php-cli.ini',
  2010. },
  2011. 'xcache': {
  2012. 'ini': '/etc/php/conf.d/xcache.ini',
  2013. },
  2014. },
  2015. }),
  2016. 'fpm': {
  2017. 'service': {
  2018. 'enabled': True,
  2019. 'opts': {},
  2020. },
  2021. 'config': {
  2022. 'ini': {
  2023. 'opts': {},
  2024. 'settings': {},
  2025. },
  2026. 'conf': {
  2027. 'opts': {},
  2028. 'settings': {},
  2029. },
  2030. },
  2031. 'pools': {
  2032. 'default.conf': {
  2033. 'enabled': False,
  2034. 'opts': {},
  2035. },
  2036. },
  2037. },
  2038. 'hhvm': {
  2039. 'service': {
  2040. 'enabled': True,
  2041. 'opts': {},
  2042. },
  2043. 'config': {
  2044. 'server': {
  2045. 'opts': {},
  2046. 'settings': {},
  2047. },
  2048. 'php': {
  2049. 'opts': {},
  2050. 'settings': {},
  2051. },
  2052. },
  2053. },
  2054. 'cli': {
  2055. 'ini': {
  2056. 'opts': {},
  2057. 'settings': {},
  2058. }
  2059. },
  2060. 'apache2': {
  2061. 'ini': {
  2062. 'opts': {},
  2063. 'settings': {},
  2064. }
  2065. },
  2066. 'xcache': {
  2067. 'ini': {
  2068. 'defaults': {
  2069. 'xcache-common': {
  2070. 'extension': 'xcache.so',
  2071. },
  2072. 'xcache.admin': {
  2073. 'xcache.admin.enable_auth': 'On',
  2074. },
  2075. 'xcache': {
  2076. 'xcache.shm_scheme': '"mmap"',
  2077. 'xcache.size': '60M',
  2078. 'xcache.count': '1',
  2079. 'xcache.slots': '8K',
  2080. 'xcache.ttl': '0',
  2081. 'xcache.gc_interval': '0',
  2082. 'xcache.var_size': '4M',
  2083. 'xcache.var_count': '1',
  2084. 'xcache.var_slots': '8K',
  2085. 'xcache.var_ttl': '0',
  2086. 'xcache.var_maxttl': '0',
  2087. 'xcache.var_gc_interval': '300',
  2088. 'xcache.var_namespace_mode': '0',
  2089. 'xcache.var_namespace': '""',
  2090. 'xcache.readonly_protection': 'Off',
  2091. 'xcache.mmap_path': '"/dev/zero"',
  2092. 'xcache.coredump_directory': '""',
  2093. 'xcache.coredump_type': '0',
  2094. 'xcache.disable_on_crash': 'Off',
  2095. 'xcache.experimental': 'Off',
  2096. 'xcache.cacher': 'On',
  2097. 'xcache.stat': 'On',
  2098. 'xcache.optimizer': 'Off',
  2099. },
  2100. 'xcache.coverager': {
  2101. 'xcache.coverager': 'Off',
  2102. 'xcache.coverager_autostart': 'On',
  2103. 'xcache.coveragedump_directory': '""',
  2104. },
  2105. },
  2106. 'opts': {},
  2107. 'settings': {},
  2108. }
  2109. },
  2110. 'ini': {
  2111. 'defaults': {
  2112. 'PHP': {
  2113. 'engine': 'On',
  2114. 'allow_url_fopen': 'On',
  2115. 'allow_url_include': 'Off',
  2116. 'asp_tags': 'Off',
  2117. 'auto_globals_jit': 'On',
  2118. 'default_mimetype': '"text/html"',
  2119. 'default_socket_timeout': 60,
  2120. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  2121. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  2122. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  2123. 'display_errors': 'Off',
  2124. 'display_startup_errors': 'Off',
  2125. 'enable_dl': 'Off',
  2126. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  2127. 'expose_php': 'On',
  2128. 'file_uploads': 'On',
  2129. 'html_errors': 'On',
  2130. 'ignore_repeated_errors': 'Off',
  2131. 'ignore_repeated_source': 'Off',
  2132. 'implicit_flush': 'Off',
  2133. 'log_errors': 'On',
  2134. 'log_errors_max_len': 1024,
  2135. 'max_execution_time': 30,
  2136. 'max_file_uploads': 20,
  2137. 'max_input_nesting_level': 64,
  2138. 'max_input_time': 60,
  2139. 'max_input_vars': 1000,
  2140. 'memory_limit': '128M',
  2141. 'output_buffering': 4096,
  2142. 'post_max_size': '8M',
  2143. 'precision': 14,
  2144. 'register_argc_argv': 'Off',
  2145. 'report_memleaks': 'On',
  2146. 'request_order': 'GP',
  2147. 'serialize_precision': 17,
  2148. 'short_open_tag': 'Off',
  2149. 'track_errors': 'Off',
  2150. 'upload_max_filesize': '2M',
  2151. 'variables_order': 'GPCS',
  2152. 'zend.enable_gc': 'On',
  2153. 'zlib.output_compression': 'Off',
  2154. },
  2155. 'CLI Server': {
  2156. 'cli_server.color': 'On'
  2157. },
  2158. 'Date': {
  2159. 'date.timezone': 'America/New_York'
  2160. },
  2161. 'Pdo_mysql': {
  2162. 'pdo_mysql.cache_size': 2000
  2163. },
  2164. 'mail function': {
  2165. 'SMTP': 'localhost',
  2166. 'mail.add_x_header': 'On'
  2167. },
  2168. 'SQL': {
  2169. 'sql.safe_mode': 'Off'
  2170. },
  2171. 'ODBC': {
  2172. 'odbc.allow_persistent': 'On',
  2173. 'odbc.check_persistent': 'On',
  2174. 'odbc.max_persistent': '-1',
  2175. 'odbc.max_links': '-1',
  2176. 'odbc.defaultlrl': 4096,
  2177. 'odbc.defaultbinmode': 1
  2178. },
  2179. 'Interbase': {
  2180. 'ibase.allow_persistent': 1,
  2181. 'ibase.max_persistent': -1,
  2182. 'ibase.max_links': -1,
  2183. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  2184. 'ibase.dateformat': '"%Y-%m-%d"',
  2185. 'ibase.timeformat': '"%H:%M:%S"'
  2186. },
  2187. 'MySQL': {
  2188. 'mysql.allow_local_infile': 'On',
  2189. 'mysql.allow_persistent': 'On',
  2190. 'mysql.cache_size': '2000',
  2191. 'mysql.max_persistent': -1,
  2192. 'mysql.max_links': -1,
  2193. 'mysql.connect_timeout': 60,
  2194. 'mysql.trace_mode': 'Off'
  2195. },
  2196. 'MySQLi': {
  2197. 'mysqli.max_persistent': -1,
  2198. 'mysqli.allow_persistent': 'On',
  2199. 'mysqli.max_links': -1,
  2200. 'mysqli.cache_size': 2000,
  2201. 'mysqli.default_port': 3306,
  2202. 'mysqli.reconnect': 'Off'
  2203. },
  2204. 'mysqlnd': {
  2205. 'mysqlnd.collect_statistics': 'On',
  2206. 'mysqlnd.collect_memory_statistics': 'Off'
  2207. },
  2208. 'PostgreSQL': {
  2209. 'pgsql.allow_persistent': 'On',
  2210. 'pgsql.auto_reset_persistent': 'Off',
  2211. 'pgsql.max_persistent': -1,
  2212. 'pgsql.max_links': -1,
  2213. 'pgsql.ignore_notice': 0,
  2214. 'pgsql.log_notice': 0
  2215. },
  2216. 'Sybase-CT': {
  2217. 'sybct.allow_persistent': 'On',
  2218. 'sybct.max_persistent': -1,
  2219. 'sybct.max_links': -1,
  2220. 'sybct.min_server_severity': 10,
  2221. 'sybct.min_client_severity': 10
  2222. },
  2223. 'bcmath': {
  2224. 'bcmath.scale': 0
  2225. },
  2226. 'Session': {
  2227. 'session.save_handler': 'files',
  2228. 'session.use_strict_mode': 0,
  2229. 'session.use_cookies': 1,
  2230. 'session.use_only_cookies': 1,
  2231. 'session.name': 'PHPSESSID',
  2232. 'session.auto_start': 0,
  2233. 'session.cookie_lifetime': 0,
  2234. 'session.cookie_path': '/',
  2235. 'session.serialize_handler': 'php',
  2236. 'session.gc_probability': 0,
  2237. 'session.gc_divisor': 1000,
  2238. 'session.gc_maxlifetime': 1440,
  2239. 'session.bug_compat_42': 'Off',
  2240. 'session.bug_compat_warn': 'Off',
  2241. 'session.cache_limiter': 'nocache',
  2242. 'session.cache_expire': '180',
  2243. 'session.use_trans_sid': 0,
  2244. 'session.hash_function': 0,
  2245. 'session.hash_bits_per_character': 5,
  2246. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  2247. },
  2248. 'MSSQL': {
  2249. 'mssql.allow_persistent': 'On',
  2250. 'mssql.max_persistent': -1,
  2251. 'mssql.max_links': -1,
  2252. 'mssql.min_error_severity': 10,
  2253. 'mssql.min_message_severity': 10,
  2254. 'mssql.compatibility_mode': 'Off',
  2255. 'mssql.secure_connection': 'Off'
  2256. },
  2257. 'Tidy': {
  2258. 'tidy.clean_output': 'Off'
  2259. },
  2260. 'soap': {
  2261. 'soap.wsdl_cache_enabled': 1,
  2262. 'soap.wsdl_cache_dir': '"/tmp"',
  2263. 'soap.wsdl_cache_ttl': 86400,
  2264. 'soap.wsdl_cache_limit': 5
  2265. },
  2266. 'ldap': {
  2267. 'ldap.max_links': -1
  2268. },
  2269. },
  2270. },
  2271. }, merge=True) %}
  2272. {%- endif %}