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.

3214 lines
156KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=jinja
  3. {%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
  4. {%- set freebsd_phpng_version = phpng_version.replace('.', '') %}
  5. {%- if salt['grains.get']('os') == "Ubuntu" %}
  6. {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %}
  7. {%- if use_external_repo %}
  8. {%- if salt['grains.get']('osrelease')|string >= '16.04' %}
  9. {%- set php = salt['pillar.get']('php:ng', {
  10. 'lookup': salt['grains.filter_by']({
  11. 'Debian': {
  12. 'pkgs': {
  13. 'adodb': 'libphp-adodb',
  14. 'apache2': 'libapache2-mod-php' + phpng_version,
  15. 'apc': 'php-apcu',
  16. 'apcu': 'php-apcu-bc',
  17. 'bcmath': 'php' + phpng_version + '-bcmath',
  18. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  19. 'cache-lite': 'php-cache-lite',
  20. 'cgi': 'php' + phpng_version + '-cgi',
  21. 'cli': 'php' + phpng_version + '-cli',
  22. 'composer_bin': 'composer',
  23. 'console-table': 'php-console-table',
  24. 'curl': 'php' + phpng_version + '-curl',
  25. 'dev': 'php' + phpng_version + '-dev',
  26. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  27. 'fpm': 'php' + phpng_version + '-fpm',
  28. 'gd': 'php' + phpng_version + '-gd',
  29. 'gearman': 'php-gearman',
  30. 'geoip': 'php-geoip',
  31. 'geshi': 'php-geshi',
  32. 'gettext': 'php' + phpng_version,
  33. 'gmp': 'php' + phpng_version + '-gmp',
  34. 'hhvm': 'hhvm',
  35. 'imagick': 'php-imagick',
  36. 'imap': 'php' + phpng_version + '-imap',
  37. 'intl': 'php' + phpng_version + '-intl',
  38. 'json': 'php' + phpng_version + '-json',
  39. 'ldap': 'php' + phpng_version + '-ldap',
  40. 'local_bin': '/usr/local/bin',
  41. 'auth-sasl': 'php-auth-sasl',
  42. 'mail': 'php-mail',
  43. 'mbstring': 'php' + phpng_version + '-mbstring',
  44. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  45. 'memcache': 'php-memcache',
  46. 'memcached': 'php-memcached',
  47. 'mongo': 'php-mongo',
  48. 'mongodb': 'php-mongodb',
  49. 'mysql': 'php' + phpng_version + '-mysql',
  50. 'mysqlnd': 'php' + phpng_version + '-mysql',
  51. 'net-smtp': 'php-net-smtp',
  52. 'net4': 'php-net-ipv4',
  53. 'net6': 'php-net-ipv6',
  54. 'oauth': 'php-oauth',
  55. 'opcache': 'php' + phpng_version + '-opcache',
  56. 'pear': 'php-pear',
  57. 'pgsql': 'php' + phpng_version + '-pgsql',
  58. 'php': 'php' + phpng_version,
  59. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  60. 'pspell': 'php' + phpng_version + '-pspell',
  61. 'redis': 'php' + phpng_version + '-redis',
  62. 'seclib': ['php-phpseclib', 'php-seclib'],
  63. 'snmp': 'php' + phpng_version + '-snmp',
  64. 'soap': 'php' + phpng_version + '-soap',
  65. 'ssh2': 'php-ssh2',
  66. 'sqlite': 'php' + phpng_version + '-sqlite3',
  67. 'suhosin5_ext': 'suhosin.so',
  68. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  69. 'suhosin7_ext': 'suhosin7.so',
  70. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  71. 'sybase': 'php' + phpng_version + '-sybase',
  72. 'tcpdf': 'php-tcpdf',
  73. 'temp_dir': '/tmp',
  74. 'tidy': 'php' + phpng_version + '-tidy',
  75. 'xdebug': 'php' + phpng_version + '-xdebug',
  76. 'xml': 'php' + phpng_version + '-xml',
  77. 'xsl': 'php' + phpng_version + '-xsl',
  78. 'zip': 'php' + phpng_version + '-zip',
  79. },
  80. 'fpm': {
  81. 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
  82. 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
  83. 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
  84. 'service': 'php' + phpng_version + '-fpm',
  85. 'user': 'root',
  86. 'group': 'root',
  87. 'defaults': odict([
  88. ('global', odict([
  89. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  90. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  91. ])),
  92. ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
  93. ]),
  94. },
  95. 'hhvm': {
  96. 'conf': '/etc/hhvm/server.ini',
  97. 'ini': '/etc/hhvm/php.ini',
  98. 'service': 'hhvm',
  99. 'defaults': {},
  100. 'server': odict([
  101. ('pid', '/var/run/hhvm/pid'),
  102. ('hhvm.server.port', '9000'),
  103. ('hhvm.server.type', 'fastcgi'),
  104. ('hhvm.server.default_document', 'index.php'),
  105. ('hhvm.log.use_log_file', 'true'),
  106. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  107. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  108. ]),
  109. 'php': odict([
  110. ('session.save_handler', 'files'),
  111. ('session.save_path', '/var/lib/hhvm/sessions'),
  112. ('session.gc_maxlifetime', '1440'),
  113. ('hhvm.log.level', 'Warning'),
  114. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  115. ('hhvm.log.runtime_error_reporting_level', '8191'),
  116. ('hhvm.mysql.typed_results', 'false'),
  117. ]),
  118. },
  119. 'cli': {
  120. 'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
  121. },
  122. 'apache2': {
  123. 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
  124. },
  125. },
  126. }),
  127. 'fpm': {
  128. 'service': {
  129. 'enabled': True,
  130. 'opts': {},
  131. },
  132. 'config': {
  133. 'ini': {
  134. 'opts': {},
  135. 'settings': {},
  136. },
  137. 'conf': {
  138. 'opts': {},
  139. 'settings': {},
  140. },
  141. },
  142. 'pools': {},
  143. },
  144. 'hhvm': {
  145. 'service': {
  146. 'enabled': True,
  147. 'opts': {},
  148. },
  149. 'config': {
  150. 'server': {
  151. 'opts': {},
  152. 'settings': {},
  153. },
  154. 'php': {
  155. 'opts': {},
  156. 'settings': {},
  157. },
  158. },
  159. },
  160. 'cli': {
  161. 'ini': {
  162. 'opts': {},
  163. 'settings': {},
  164. }
  165. },
  166. 'apache2': {
  167. 'ini': {
  168. 'opts': {},
  169. 'settings': {},
  170. }
  171. },
  172. 'ini': {
  173. 'defaults': {
  174. 'PHP': {
  175. 'allow_url_fopen': 'On',
  176. 'allow_url_include': 'Off',
  177. 'asp_tags': 'Off',
  178. 'auto_globals_jit': 'On',
  179. 'default_mimetype': '"text/html"',
  180. 'default_socket_timeout': 60,
  181. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  182. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  183. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  184. 'display_errors': 'Off',
  185. 'display_startup_errors': 'Off',
  186. 'enable_dl': 'Off',
  187. 'engine': 'On',
  188. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  189. 'expose_php': 'On',
  190. 'file_uploads': 'On',
  191. 'html_errors': 'On',
  192. 'ignore_repeated_errors': 'Off',
  193. 'ignore_repeated_source': 'Off',
  194. 'implicit_flush': 'Off',
  195. 'log_errors': 'On',
  196. 'log_errors_max_len': 1024,
  197. 'max_execution_time': 30,
  198. 'max_file_uploads': 20,
  199. 'max_input_nesting_level': 64,
  200. 'max_input_time': 60,
  201. 'max_input_vars': 1000,
  202. 'memory_limit': '128M',
  203. 'output_buffering': 4096,
  204. 'post_max_size': '8M',
  205. 'precision': 14,
  206. 'register_argc_argv': 'Off',
  207. 'report_memleaks': 'On',
  208. 'request_order': 'GP',
  209. 'serialize_precision': 17,
  210. 'short_open_tag': 'Off',
  211. 'track_errors': 'Off',
  212. 'upload_max_filesize': '2M',
  213. 'variables_order': 'GPCS',
  214. 'zend.enable_gc': 'On',
  215. 'zlib.output_compression': 'Off',
  216. },
  217. 'CLI Server': {
  218. 'cli_server.color': 'On'
  219. },
  220. 'Date': {
  221. 'date.timezone': 'America/New_York'
  222. },
  223. 'Pdo_mysql': {
  224. 'pdo_mysql.cache_size': 2000
  225. },
  226. 'mail function': {
  227. 'SMTP': 'localhost',
  228. 'mail.add_x_header': 'On'
  229. },
  230. 'SQL': {
  231. 'sql.safe_mode': 'Off'
  232. },
  233. 'ODBC': {
  234. 'odbc.allow_persistent': 'On',
  235. 'odbc.check_persistent': 'On',
  236. 'odbc.max_persistent': '-1',
  237. 'odbc.max_links': '-1',
  238. 'odbc.defaultlrl': 4096,
  239. 'odbc.defaultbinmode': 1
  240. },
  241. 'Interbase': {
  242. 'ibase.allow_persistent': 1,
  243. 'ibase.max_persistent': -1,
  244. 'ibase.max_links': -1,
  245. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  246. 'ibase.dateformat': '"%Y-%m-%d"',
  247. 'ibase.timeformat': '"%H:%M:%S"'
  248. },
  249. 'MySQL': {
  250. 'mysql.allow_local_infile': 'On',
  251. 'mysql.allow_persistent': 'On',
  252. 'mysql.cache_size': '2000',
  253. 'mysql.max_persistent': -1,
  254. 'mysql.max_links': -1,
  255. 'mysql.connect_timeout': 60,
  256. 'mysql.trace_mode': 'Off'
  257. },
  258. 'MySQLi': {
  259. 'mysqli.max_persistent': -1,
  260. 'mysqli.allow_persistent': 'On',
  261. 'mysqli.max_links': -1,
  262. 'mysqli.cache_size': 2000,
  263. 'mysqli.default_port': 3306,
  264. 'mysqli.reconnect': 'Off'
  265. },
  266. 'mysqlnd': {
  267. 'mysqlnd.collect_statistics': 'On',
  268. 'mysqlnd.collect_memory_statistics': 'Off'
  269. },
  270. 'PostgreSQL': {
  271. 'pgsql.allow_persistent': 'On',
  272. 'pgsql.auto_reset_persistent': 'Off',
  273. 'pgsql.max_persistent': -1,
  274. 'pgsql.max_links': -1,
  275. 'pgsql.ignore_notice': 0,
  276. 'pgsql.log_notice': 0
  277. },
  278. 'Sybase-CT': {
  279. 'sybct.allow_persistent': 'On',
  280. 'sybct.max_persistent': -1,
  281. 'sybct.max_links': -1,
  282. 'sybct.min_server_severity': 10,
  283. 'sybct.min_client_severity': 10
  284. },
  285. 'bcmath': {
  286. 'bcmath.scale': 0
  287. },
  288. 'Session': {
  289. 'session.save_handler': 'files',
  290. 'session.use_strict_mode': 0,
  291. 'session.use_cookies': 1,
  292. 'session.use_only_cookies': 1,
  293. 'session.name': 'PHPSESSID',
  294. 'session.auto_start': 0,
  295. 'session.cookie_lifetime': 0,
  296. 'session.cookie_path': '/',
  297. 'session.serialize_handler': 'php',
  298. 'session.gc_probability': 0,
  299. 'session.gc_divisor': 1000,
  300. 'session.gc_maxlifetime': 1440,
  301. 'session.bug_compat_42': 'Off',
  302. 'session.bug_compat_warn': 'Off',
  303. 'session.cache_limiter': 'nocache',
  304. 'session.cache_expire': '180',
  305. 'session.use_trans_sid': 0,
  306. 'session.hash_function': 0,
  307. 'session.hash_bits_per_character': 5,
  308. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  309. },
  310. 'MSSQL': {
  311. 'mssql.allow_persistent': 'On',
  312. 'mssql.max_persistent': -1,
  313. 'mssql.max_links': -1,
  314. 'mssql.min_error_severity': 10,
  315. 'mssql.min_message_severity': 10,
  316. 'mssql.compatibility_mode': 'Off',
  317. 'mssql.secure_connection': 'Off'
  318. },
  319. 'Tidy': {
  320. 'tidy.clean_output': 'Off'
  321. },
  322. 'soap': {
  323. 'soap.wsdl_cache_enabled': 1,
  324. 'soap.wsdl_cache_dir': '"/tmp"',
  325. 'soap.wsdl_cache_ttl': 86400,
  326. 'soap.wsdl_cache_limit': 5
  327. },
  328. 'ldap': {
  329. 'ldap.max_links': -1
  330. },
  331. },
  332. },
  333. }, merge=True) %}
  334. {%- else %}
  335. {%- set php = salt['pillar.get']('php:ng', {
  336. 'lookup': salt['grains.filter_by']({
  337. 'Debian': {
  338. 'pkgs': {
  339. 'adodb': 'libphp-adodb',
  340. 'apache2': 'libapache2-mod-php' + phpng_version,
  341. 'apc': 'php-apcu',
  342. 'apcu': 'php-apcu-bc',
  343. 'bcmath': 'php' + phpng_version + '-bcmath',
  344. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  345. 'cache-lite': 'php-cache-lite',
  346. 'cgi': 'php' + phpng_version + '-cgi',
  347. 'cli': 'php' + phpng_version + '-cli',
  348. 'composer_bin': 'composer',
  349. 'console-table': 'php-console-table',
  350. 'curl': 'php' + phpng_version + '-curl',
  351. 'dev': 'php' + phpng_version + '-dev',
  352. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  353. 'fpm': 'php' + phpng_version + '-fpm',
  354. 'gd': 'php' + phpng_version + '-gd',
  355. 'gearman': 'php-gearman',
  356. 'geoip': 'php-geoip',
  357. 'geshi': 'php-geshi',
  358. 'gettext': 'php' + phpng_version,
  359. 'gmp': 'php' + phpng_version + '-gmp',
  360. 'hhvm': 'hhvm',
  361. 'imagick': 'php-imagick',
  362. 'imap': 'php' + phpng_version + '-imap',
  363. 'intl': 'php' + phpng_version + '-intl',
  364. 'json': 'php' + phpng_version + '-json',
  365. 'ldap': 'php' + phpng_version + '-ldap',
  366. 'local_bin': '/usr/local/bin',
  367. 'auth-sasl': 'php-auth-sasl',
  368. 'mail': 'php-mail',
  369. 'mbstring': 'php' + phpng_version + '-mbstring',
  370. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  371. 'memcache': 'php-memcache',
  372. 'memcached': 'php-memcached',
  373. 'mongo': 'php-mongo',
  374. 'mongodb': 'php-mongodb',
  375. 'mysql': 'php' + phpng_version + '-mysql',
  376. 'mysqlnd': 'php' + phpng_version + '-mysql',
  377. 'net-smtp': 'php-net-smtp',
  378. 'net4': 'php-net-ipv4',
  379. 'net6': 'php-net-ipv6',
  380. 'oauth': 'php-oauth',
  381. 'opcache': 'php' + phpng_version + '-opcache',
  382. 'pear': 'php-pear',
  383. 'pgsql': 'php' + phpng_version + '-pgsql',
  384. 'php': 'php' + phpng_version,
  385. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  386. 'pspell': 'php' + phpng_version + '-pspell',
  387. 'readline': 'php' + phpng_version + '-readline',
  388. 'redis': 'php' + phpng_version + '-redis',
  389. 'seclib': 'php-seclib',
  390. 'snmp': 'php' + phpng_version + '-snmp',
  391. 'soap': 'php' + phpng_version + '-soap',
  392. 'ssh2': 'php-ssh2',
  393. 'sqlite': 'php' + phpng_version + '-sqlite3',
  394. 'suhosin5_ext': 'suhosin.so',
  395. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  396. 'suhosin7_ext': 'suhosin7.so',
  397. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  398. 'sybase': 'php' + phpng_version + '-sybase',
  399. 'tcpdf': 'php-tcpdf',
  400. 'temp_dir': '/tmp',
  401. 'tidy': 'php' + phpng_version + '-tidy',
  402. 'xdebug': 'php' + phpng_version + '-xdebug',
  403. 'xml': 'php' + phpng_version + '-xml',
  404. 'xsl': 'php' + phpng_version + '-xsl',
  405. 'zip': 'php' + phpng_version + '-zip',
  406. },
  407. 'fpm': {
  408. 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
  409. 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
  410. 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
  411. 'service': 'php' + phpng_version + '-fpm',
  412. 'user': 'root',
  413. 'group': 'root',
  414. 'defaults': odict([
  415. ('global', odict([
  416. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  417. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  418. ])),
  419. ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
  420. ]),
  421. },
  422. 'hhvm': {
  423. 'conf': '/etc/hhvm/server.ini',
  424. 'ini': '/etc/hhvm/php.ini',
  425. 'service': 'hhvm',
  426. 'defaults': {},
  427. 'server': odict([
  428. ('pid', '/var/run/hhvm/pid'),
  429. ('hhvm.server.port', '9000'),
  430. ('hhvm.server.type', 'fastcgi'),
  431. ('hhvm.server.default_document', 'index.php'),
  432. ('hhvm.log.use_log_file', 'true'),
  433. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  434. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  435. ]),
  436. 'php': odict([
  437. ('session.save_handler', 'files'),
  438. ('session.save_path', '/var/lib/hhvm/sessions'),
  439. ('session.gc_maxlifetime', '1440'),
  440. ('hhvm.log.level', 'Warning'),
  441. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  442. ('hhvm.log.runtime_error_reporting_level', '8191'),
  443. ('hhvm.mysql.typed_results', 'false'),
  444. ]),
  445. },
  446. 'cli': {
  447. 'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
  448. },
  449. 'apache2': {
  450. 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
  451. },
  452. },
  453. }),
  454. 'fpm': {
  455. 'service': {
  456. 'enabled': True,
  457. 'opts': {},
  458. },
  459. 'config': {
  460. 'ini': {
  461. 'opts': {},
  462. 'settings': {},
  463. },
  464. 'conf': {
  465. 'opts': {},
  466. 'settings': {},
  467. },
  468. },
  469. 'pools': {},
  470. },
  471. 'hhvm': {
  472. 'service': {
  473. 'enabled': True,
  474. 'opts': {},
  475. },
  476. 'config': {
  477. 'server': {
  478. 'opts': {},
  479. 'settings': {},
  480. },
  481. 'php': {
  482. 'opts': {},
  483. 'settings': {},
  484. },
  485. },
  486. },
  487. 'cli': {
  488. 'ini': {
  489. 'opts': {},
  490. 'settings': {},
  491. }
  492. },
  493. 'apache2': {
  494. 'ini': {
  495. 'opts': {},
  496. 'settings': {},
  497. }
  498. },
  499. 'ini': {
  500. 'defaults': {
  501. 'PHP': {
  502. 'allow_url_fopen': 'On',
  503. 'allow_url_include': 'Off',
  504. 'asp_tags': 'Off',
  505. 'auto_globals_jit': 'On',
  506. 'default_mimetype': '"text/html"',
  507. 'default_socket_timeout': 60,
  508. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  509. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  510. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  511. 'display_errors': 'Off',
  512. 'display_startup_errors': 'Off',
  513. 'enable_dl': 'Off',
  514. 'engine': 'On',
  515. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  516. 'expose_php': 'On',
  517. 'file_uploads': 'On',
  518. 'html_errors': 'On',
  519. 'ignore_repeated_errors': 'Off',
  520. 'ignore_repeated_source': 'Off',
  521. 'implicit_flush': 'Off',
  522. 'log_errors': 'On',
  523. 'log_errors_max_len': 1024,
  524. 'max_execution_time': 30,
  525. 'max_file_uploads': 20,
  526. 'max_input_nesting_level': 64,
  527. 'max_input_time': 60,
  528. 'max_input_vars': 1000,
  529. 'memory_limit': '128M',
  530. 'output_buffering': 4096,
  531. 'post_max_size': '8M',
  532. 'precision': 14,
  533. 'register_argc_argv': 'Off',
  534. 'report_memleaks': 'On',
  535. 'request_order': 'GP',
  536. 'serialize_precision': 17,
  537. 'short_open_tag': 'Off',
  538. 'track_errors': 'Off',
  539. 'upload_max_filesize': '2M',
  540. 'variables_order': 'GPCS',
  541. 'zend.enable_gc': 'On',
  542. 'zlib.output_compression': 'Off',
  543. },
  544. 'CLI Server': {
  545. 'cli_server.color': 'On'
  546. },
  547. 'Date': {
  548. 'date.timezone': 'America/New_York'
  549. },
  550. 'Pdo_mysql': {
  551. 'pdo_mysql.cache_size': 2000
  552. },
  553. 'mail function': {
  554. 'SMTP': 'localhost',
  555. 'mail.add_x_header': 'On'
  556. },
  557. 'SQL': {
  558. 'sql.safe_mode': 'Off'
  559. },
  560. 'ODBC': {
  561. 'odbc.allow_persistent': 'On',
  562. 'odbc.check_persistent': 'On',
  563. 'odbc.max_persistent': '-1',
  564. 'odbc.max_links': '-1',
  565. 'odbc.defaultlrl': 4096,
  566. 'odbc.defaultbinmode': 1
  567. },
  568. 'Interbase': {
  569. 'ibase.allow_persistent': 1,
  570. 'ibase.max_persistent': -1,
  571. 'ibase.max_links': -1,
  572. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  573. 'ibase.dateformat': '"%Y-%m-%d"',
  574. 'ibase.timeformat': '"%H:%M:%S"'
  575. },
  576. 'MySQL': {
  577. 'mysql.allow_local_infile': 'On',
  578. 'mysql.allow_persistent': 'On',
  579. 'mysql.cache_size': '2000',
  580. 'mysql.max_persistent': -1,
  581. 'mysql.max_links': -1,
  582. 'mysql.connect_timeout': 60,
  583. 'mysql.trace_mode': 'Off'
  584. },
  585. 'MySQLi': {
  586. 'mysqli.max_persistent': -1,
  587. 'mysqli.allow_persistent': 'On',
  588. 'mysqli.max_links': -1,
  589. 'mysqli.cache_size': 2000,
  590. 'mysqli.default_port': 3306,
  591. 'mysqli.reconnect': 'Off'
  592. },
  593. 'mysqlnd': {
  594. 'mysqlnd.collect_statistics': 'On',
  595. 'mysqlnd.collect_memory_statistics': 'Off'
  596. },
  597. 'PostgreSQL': {
  598. 'pgsql.allow_persistent': 'On',
  599. 'pgsql.auto_reset_persistent': 'Off',
  600. 'pgsql.max_persistent': -1,
  601. 'pgsql.max_links': -1,
  602. 'pgsql.ignore_notice': 0,
  603. 'pgsql.log_notice': 0
  604. },
  605. 'Sybase-CT': {
  606. 'sybct.allow_persistent': 'On',
  607. 'sybct.max_persistent': -1,
  608. 'sybct.max_links': -1,
  609. 'sybct.min_server_severity': 10,
  610. 'sybct.min_client_severity': 10
  611. },
  612. 'bcmath': {
  613. 'bcmath.scale': 0
  614. },
  615. 'Session': {
  616. 'session.save_handler': 'files',
  617. 'session.use_strict_mode': 0,
  618. 'session.use_cookies': 1,
  619. 'session.use_only_cookies': 1,
  620. 'session.name': 'PHPSESSID',
  621. 'session.auto_start': 0,
  622. 'session.cookie_lifetime': 0,
  623. 'session.cookie_path': '/',
  624. 'session.serialize_handler': 'php',
  625. 'session.gc_probability': 0,
  626. 'session.gc_divisor': 1000,
  627. 'session.gc_maxlifetime': 1440,
  628. 'session.bug_compat_42': 'Off',
  629. 'session.bug_compat_warn': 'Off',
  630. 'session.cache_limiter': 'nocache',
  631. 'session.cache_expire': '180',
  632. 'session.use_trans_sid': 0,
  633. 'session.hash_function': 0,
  634. 'session.hash_bits_per_character': 5,
  635. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  636. },
  637. 'MSSQL': {
  638. 'mssql.allow_persistent': 'On',
  639. 'mssql.max_persistent': -1,
  640. 'mssql.max_links': -1,
  641. 'mssql.min_error_severity': 10,
  642. 'mssql.min_message_severity': 10,
  643. 'mssql.compatibility_mode': 'Off',
  644. 'mssql.secure_connection': 'Off'
  645. },
  646. 'Tidy': {
  647. 'tidy.clean_output': 'Off'
  648. },
  649. 'soap': {
  650. 'soap.wsdl_cache_enabled': 1,
  651. 'soap.wsdl_cache_dir': '"/tmp"',
  652. 'soap.wsdl_cache_ttl': 86400,
  653. 'soap.wsdl_cache_limit': 5
  654. },
  655. 'ldap': {
  656. 'ldap.max_links': -1
  657. },
  658. },
  659. },
  660. }, merge=True) %}
  661. {%- endif %}
  662. {%- else %}
  663. {%- if salt['grains.get']('osrelease')|string >= '18.04' %}
  664. {%- set php = salt['pillar.get']('php:ng', {
  665. 'lookup': salt['grains.filter_by']({
  666. 'Ubuntu': {
  667. 'pkgs': {
  668. 'adodb': 'libphp-adodb',
  669. 'apache2': 'libapache2-mod-php',
  670. 'apc': 'php',
  671. 'apcu': 'php-apcu',
  672. 'bcmath': 'php7.2-bcmath',
  673. 'cache-lite': 'php-cache-lite',
  674. 'cgi': 'php-cgi',
  675. 'cli': 'php-cli',
  676. 'console-table': 'php-console-table',
  677. 'composer_bin': 'composer',
  678. 'curl': 'php-curl',
  679. 'dev': 'php7.2-dev',
  680. 'fpm': 'php-fpm',
  681. 'gd': 'php-gd',
  682. 'geoip': 'php-geoip',
  683. 'geshi': 'php-geshi',
  684. 'gmp': 'php-gmp',
  685. 'hhvm': 'hhvm',
  686. 'imagick': 'php-imagick',
  687. 'imap': 'php-imap',
  688. 'intl': 'php-intl',
  689. 'json': 'php-json',
  690. 'ldap': 'php-ldap',
  691. 'local_bin': '/usr/local/bin',
  692. 'auth-sasl': 'php-auth-sasl',
  693. 'mail': 'php-mail',
  694. 'mbstring': 'php-mbstring',
  695. 'mcrypt': 'php-mcrypt',
  696. 'memcache': 'php-memcache',
  697. 'memcached': 'php-memcached',
  698. 'mongodb': 'php-mongodb',
  699. 'mysql': 'php-mysql',
  700. 'mysqlnd': 'php',
  701. 'net-smtp': 'php-net-smtp',
  702. 'net4': 'php-net-ipv4',
  703. 'net6': 'php-net-ipv6',
  704. 'oauth': 'php-oauth',
  705. 'opcache': 'php7.2-opcache',
  706. 'pear': 'php-pear',
  707. 'pgsql': 'php-pgsql',
  708. 'php': 'php',
  709. 'phpenmod_command': 'phpenmod',
  710. 'pspell': 'php-pspell',
  711. 'redis': 'php-redis',
  712. 'seclib': ['php-phpseclib', 'php-seclib'],
  713. 'snmp': 'php-snmp',
  714. 'soap': 'php-soap',
  715. 'sqlite': 'php-sqlite3',
  716. 'ssh2': 'php-ssh2',
  717. 'suhosin': 'php',
  718. 'sybase': 'php-sybase',
  719. 'tcpdf': 'php-tcpdf',
  720. 'temp_dir': '/tmp',
  721. 'tidy': 'php7.2-tidy',
  722. 'xcache': 'php',
  723. 'xdebug': 'php-xdebug',
  724. 'xml': 'php-xml',
  725. 'xsl': 'php7.2-xsl',
  726. 'zip': 'php-zip',
  727. },
  728. 'fpm': {
  729. 'conf': '/etc/php/7.2/fpm/php-fpm.conf',
  730. 'ini': '/etc/php/7.2/fpm/php.ini',
  731. 'pools': '/etc/php/7.2/fpm/pool.d',
  732. 'service': 'php7.2-fpm',
  733. 'user': 'root',
  734. 'group': 'root',
  735. 'defaults': odict([
  736. ('global', odict([
  737. ('pid', '/var/run/php7.2-fpm.pid'),
  738. ('error_log', '/var/log/php7.2-fpm.log'),
  739. ])),
  740. ('include', '/etc/php/7.2/fpm/pool.d/*.conf'),
  741. ]),
  742. },
  743. 'hhvm': {
  744. 'conf': '/etc/hhvm/server.ini',
  745. 'ini': '/etc/hhvm/php.ini',
  746. 'service': 'hhvm',
  747. 'defaults': {},
  748. 'server': odict([
  749. ('pid', '/var/run/hhvm/pid'),
  750. ('hhvm.server.port', '9000'),
  751. ('hhvm.server.type', 'fastcgi'),
  752. ('hhvm.server.default_document', 'index.php'),
  753. ('hhvm.log.use_log_file', 'true'),
  754. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  755. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  756. ]),
  757. 'php': odict([
  758. ('session.save_handler', 'files'),
  759. ('session.save_path', '/var/lib/hhvm/sessions'),
  760. ('session.gc_maxlifetime', '1440'),
  761. ('hhvm.log.level', 'Warning'),
  762. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  763. ('hhvm.log.runtime_error_reporting_level', '8191'),
  764. ('hhvm.mysql.typed_results', 'false'),
  765. ]),
  766. },
  767. 'cli': {
  768. 'ini': '/etc/php/7.2/cli/php.ini',
  769. },
  770. 'apache2': {
  771. 'ini': '/etc/php/7.2/apache2/php.ini',
  772. },
  773. 'xcache': {
  774. 'ini': '/etc/php/7.2/mods-available/xcache.ini',
  775. 'defaults': {},
  776. },
  777. },
  778. }, grain="os"),
  779. 'fpm': {
  780. 'service': {
  781. 'enabled': True,
  782. 'opts': {},
  783. },
  784. 'config': {
  785. 'ini': {
  786. 'opts': {},
  787. 'settings': {},
  788. },
  789. 'conf': {
  790. 'opts': {},
  791. 'settings': {},
  792. },
  793. },
  794. 'pools': {
  795. 'default.conf': {
  796. 'enabled': False,
  797. 'opts': {},
  798. },
  799. },
  800. },
  801. 'hhvm': {
  802. 'service': {
  803. 'enabled': True,
  804. 'opts': {},
  805. },
  806. 'config': {
  807. 'server': {
  808. 'opts': {},
  809. 'settings': {},
  810. },
  811. 'php': {
  812. 'opts': {},
  813. 'settings': {},
  814. },
  815. },
  816. },
  817. 'cli': {
  818. 'ini': {
  819. 'opts': {},
  820. 'settings': {},
  821. }
  822. },
  823. 'apache2': {
  824. 'ini': {
  825. 'opts': {},
  826. 'settings': {},
  827. }
  828. },
  829. 'xcache': {
  830. 'ini': {
  831. 'defaults': {
  832. 'xcache-common': {
  833. 'extension': 'xcache.so',
  834. },
  835. 'xcache.admin': {
  836. 'xcache.admin.enable_auth': 'On',
  837. },
  838. 'xcache': {
  839. 'xcache.shm_scheme': '"mmap"',
  840. 'xcache.size': '60M',
  841. 'xcache.count': '1',
  842. 'xcache.slots': '8K',
  843. 'xcache.ttl': '0',
  844. 'xcache.gc_interval': '0',
  845. 'xcache.var_size': '4M',
  846. 'xcache.var_count': '1',
  847. 'xcache.var_slots': '8K',
  848. 'xcache.var_ttl': '0',
  849. 'xcache.var_maxttl': '0',
  850. 'xcache.var_gc_interval': '300',
  851. 'xcache.var_namespace_mode': '0',
  852. 'xcache.var_namespace': '""',
  853. 'xcache.readonly_protection': 'Off',
  854. 'xcache.mmap_path': '"/dev/zero"',
  855. 'xcache.coredump_directory': '""',
  856. 'xcache.coredump_type': '0',
  857. 'xcache.disable_on_crash': 'Off',
  858. 'xcache.experimental': 'Off',
  859. 'xcache.cacher': 'On',
  860. 'xcache.stat': 'On',
  861. 'xcache.optimizer': 'Off',
  862. },
  863. 'xcache.coverager': {
  864. 'xcache.coverager': 'Off',
  865. 'xcache.coverager_autostart': 'On',
  866. 'xcache.coveragedump_directory': '""',
  867. },
  868. },
  869. 'opts': {},
  870. 'settings': {},
  871. }
  872. },
  873. 'ini': {
  874. 'defaults': {
  875. 'PHP': {
  876. 'allow_url_fopen': 'On',
  877. 'allow_url_include': 'Off',
  878. 'asp_tags': 'Off',
  879. 'auto_globals_jit': 'On',
  880. 'default_mimetype': '"text/html"',
  881. 'default_socket_timeout': 60,
  882. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  883. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  884. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  885. 'display_errors': 'Off',
  886. 'display_startup_errors': 'Off',
  887. 'enable_dl': 'Off',
  888. 'engine': 'On',
  889. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  890. 'expose_php': 'On',
  891. 'file_uploads': 'On',
  892. 'html_errors': 'On',
  893. 'ignore_repeated_errors': 'Off',
  894. 'ignore_repeated_source': 'Off',
  895. 'implicit_flush': 'Off',
  896. 'log_errors': 'On',
  897. 'log_errors_max_len': 1024,
  898. 'max_execution_time': 30,
  899. 'max_file_uploads': 20,
  900. 'max_input_nesting_level': 64,
  901. 'max_input_time': 60,
  902. 'max_input_vars': 1000,
  903. 'memory_limit': '128M',
  904. 'output_buffering': 4096,
  905. 'post_max_size': '8M',
  906. 'precision': 14,
  907. 'register_argc_argv': 'Off',
  908. 'report_memleaks': 'On',
  909. 'request_order': 'GP',
  910. 'serialize_precision': 17,
  911. 'short_open_tag': 'Off',
  912. 'track_errors': 'Off',
  913. 'upload_max_filesize': '2M',
  914. 'variables_order': 'GPCS',
  915. 'zend.enable_gc': 'On',
  916. 'zlib.output_compression': 'Off',
  917. },
  918. 'CLI Server': {
  919. 'cli_server.color': 'On'
  920. },
  921. 'Date': {
  922. 'date.timezone': 'America/New_York'
  923. },
  924. 'Pdo_mysql': {
  925. 'pdo_mysql.cache_size': 2000
  926. },
  927. 'mail function': {
  928. 'SMTP': 'localhost',
  929. 'mail.add_x_header': 'On'
  930. },
  931. 'SQL': {
  932. 'sql.safe_mode': 'Off'
  933. },
  934. 'ODBC': {
  935. 'odbc.allow_persistent': 'On',
  936. 'odbc.check_persistent': 'On',
  937. 'odbc.max_persistent': '-1',
  938. 'odbc.max_links': '-1',
  939. 'odbc.defaultlrl': 4096,
  940. 'odbc.defaultbinmode': 1
  941. },
  942. 'Interbase': {
  943. 'ibase.allow_persistent': 1,
  944. 'ibase.max_persistent': -1,
  945. 'ibase.max_links': -1,
  946. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  947. 'ibase.dateformat': '"%Y-%m-%d"',
  948. 'ibase.timeformat': '"%H:%M:%S"'
  949. },
  950. 'MySQL': {
  951. 'mysql.allow_local_infile': 'On',
  952. 'mysql.allow_persistent': 'On',
  953. 'mysql.cache_size': '2000',
  954. 'mysql.max_persistent': -1,
  955. 'mysql.max_links': -1,
  956. 'mysql.connect_timeout': 60,
  957. 'mysql.trace_mode': 'Off'
  958. },
  959. 'MySQLi': {
  960. 'mysqli.max_persistent': -1,
  961. 'mysqli.allow_persistent': 'On',
  962. 'mysqli.max_links': -1,
  963. 'mysqli.cache_size': 2000,
  964. 'mysqli.default_port': 3306,
  965. 'mysqli.reconnect': 'Off'
  966. },
  967. 'mysqlnd': {
  968. 'mysqlnd.collect_statistics': 'On',
  969. 'mysqlnd.collect_memory_statistics': 'Off'
  970. },
  971. 'PostgreSQL': {
  972. 'pgsql.allow_persistent': 'On',
  973. 'pgsql.auto_reset_persistent': 'Off',
  974. 'pgsql.max_persistent': -1,
  975. 'pgsql.max_links': -1,
  976. 'pgsql.ignore_notice': 0,
  977. 'pgsql.log_notice': 0
  978. },
  979. 'Sybase-CT': {
  980. 'sybct.allow_persistent': 'On',
  981. 'sybct.max_persistent': -1,
  982. 'sybct.max_links': -1,
  983. 'sybct.min_server_severity': 10,
  984. 'sybct.min_client_severity': 10
  985. },
  986. 'bcmath': {
  987. 'bcmath.scale': 0
  988. },
  989. 'Session': {
  990. 'session.save_handler': 'files',
  991. 'session.use_strict_mode': 0,
  992. 'session.use_cookies': 1,
  993. 'session.use_only_cookies': 1,
  994. 'session.name': 'PHPSESSID',
  995. 'session.auto_start': 0,
  996. 'session.cookie_lifetime': 0,
  997. 'session.cookie_path': '/',
  998. 'session.serialize_handler': 'php',
  999. 'session.gc_probability': 0,
  1000. 'session.gc_divisor': 1000,
  1001. 'session.gc_maxlifetime': 1440,
  1002. 'session.bug_compat_42': 'Off',
  1003. 'session.bug_compat_warn': 'Off',
  1004. 'session.cache_limiter': 'nocache',
  1005. 'session.cache_expire': '180',
  1006. 'session.use_trans_sid': 0,
  1007. 'session.hash_function': 0,
  1008. 'session.hash_bits_per_character': 5,
  1009. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1010. },
  1011. 'MSSQL': {
  1012. 'mssql.allow_persistent': 'On',
  1013. 'mssql.max_persistent': -1,
  1014. 'mssql.max_links': -1,
  1015. 'mssql.min_error_severity': 10,
  1016. 'mssql.min_message_severity': 10,
  1017. 'mssql.compatibility_mode': 'Off',
  1018. 'mssql.secure_connection': 'Off'
  1019. },
  1020. 'Tidy': {
  1021. 'tidy.clean_output': 'Off'
  1022. },
  1023. 'soap': {
  1024. 'soap.wsdl_cache_enabled': 1,
  1025. 'soap.wsdl_cache_dir': '"/tmp"',
  1026. 'soap.wsdl_cache_ttl': 86400,
  1027. 'soap.wsdl_cache_limit': 5
  1028. },
  1029. 'ldap': {
  1030. 'ldap.max_links': -1
  1031. },
  1032. },
  1033. },
  1034. }, merge=True) %}
  1035. {%- elif salt['grains.get']('osrelease')|string >= '17.10' %}
  1036. {%- set php = salt['pillar.get']('php:ng', {
  1037. 'lookup': salt['grains.filter_by']({
  1038. 'Ubuntu': {
  1039. 'pkgs': {
  1040. 'adodb': 'libphp-adodb',
  1041. 'apache2': 'libapache2-mod-php',
  1042. 'apc': 'php',
  1043. 'apcu': 'php-apcu',
  1044. 'bcmath': 'php7.1-bcmath',
  1045. 'cache-lite': 'php-cache-lite',
  1046. 'cgi': 'php-cgi',
  1047. 'cli': 'php-cli',
  1048. 'console-table': 'php-console-table',
  1049. 'composer_bin': 'composer',
  1050. 'curl': 'php-curl',
  1051. 'dev': 'php7.1-dev',
  1052. 'fpm': 'php-fpm',
  1053. 'gd': 'php-gd',
  1054. 'geoip': 'php-geoip',
  1055. 'geshi': 'php-geshi',
  1056. 'gmp': 'php-gmp',
  1057. 'hhvm': 'hhvm',
  1058. 'imagick': 'php-imagick',
  1059. 'imap': 'php-imap',
  1060. 'intl': 'php-intl',
  1061. 'json': 'php-json',
  1062. 'ldap': 'php-ldap',
  1063. 'local_bin': '/usr/local/bin',
  1064. 'auth-sasl': 'php-auth-sasl',
  1065. 'mail': 'php-mail',
  1066. 'mbstring': 'php-mbstring',
  1067. 'mcrypt': 'php-mcrypt',
  1068. 'memcache': 'php-memcache',
  1069. 'memcached': 'php-memcached',
  1070. 'mongodb': 'php-mongodb',
  1071. 'mysql': 'php-mysql',
  1072. 'mysqlnd': 'php',
  1073. 'net-smtp': 'php-net-smtp',
  1074. 'net4': 'php-net-ipv4',
  1075. 'net6': 'php-net-ipv6',
  1076. 'oauth': 'php-oauth',
  1077. 'opcache': 'php7.1-opcache',
  1078. 'pear': 'php-pear',
  1079. 'pgsql': 'php-pgsql',
  1080. 'php': 'php',
  1081. 'phpenmod_command': 'phpenmod',
  1082. 'pspell': 'php-pspell',
  1083. 'redis': 'php-redis',
  1084. 'seclib': ['php-phpseclib', 'php-seclib'],
  1085. 'snmp': 'php-snmp',
  1086. 'soap': 'php-soap',
  1087. 'sqlite': 'php-sqlite3',
  1088. 'ssh2': 'php-ssh2',
  1089. 'suhosin': 'php',
  1090. 'sybase': 'php-sybase',
  1091. 'tcpdf': 'php-tcpdf',
  1092. 'temp_dir': '/tmp',
  1093. 'tidy': 'php7.1-tidy',
  1094. 'xcache': 'php',
  1095. 'xdebug': 'php-xdebug',
  1096. 'xml': 'php-xml',
  1097. 'xsl': 'php7.1-xsl',
  1098. 'zip': 'php-zip',
  1099. },
  1100. 'fpm': {
  1101. 'conf': '/etc/php/7.1/fpm/php-fpm.conf',
  1102. 'ini': '/etc/php/7.1/fpm/php.ini',
  1103. 'pools': '/etc/php/7.1/fpm/pool.d',
  1104. 'service': 'php7.1-fpm',
  1105. 'user': 'root',
  1106. 'group': 'root',
  1107. 'defaults': odict([
  1108. ('global', odict([
  1109. ('pid', '/var/run/php7.1-fpm.pid'),
  1110. ('error_log', '/var/log/php7.1-fpm.log'),
  1111. ])),
  1112. ('include', '/etc/php/7.1/fpm/pool.d/*.conf'),
  1113. ]),
  1114. },
  1115. 'hhvm': {
  1116. 'conf': '/etc/hhvm/server.ini',
  1117. 'ini': '/etc/hhvm/php.ini',
  1118. 'service': 'hhvm',
  1119. 'defaults': {},
  1120. 'server': odict([
  1121. ('pid', '/var/run/hhvm/pid'),
  1122. ('hhvm.server.port', '9000'),
  1123. ('hhvm.server.type', 'fastcgi'),
  1124. ('hhvm.server.default_document', 'index.php'),
  1125. ('hhvm.log.use_log_file', 'true'),
  1126. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1127. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1128. ]),
  1129. 'php': odict([
  1130. ('session.save_handler', 'files'),
  1131. ('session.save_path', '/var/lib/hhvm/sessions'),
  1132. ('session.gc_maxlifetime', '1440'),
  1133. ('hhvm.log.level', 'Warning'),
  1134. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1135. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1136. ('hhvm.mysql.typed_results', 'false'),
  1137. ]),
  1138. },
  1139. 'cli': {
  1140. 'ini': '/etc/php/7.1/cli/php.ini',
  1141. },
  1142. 'apache2': {
  1143. 'ini': '/etc/php/7.1/apache2/php.ini',
  1144. },
  1145. 'xcache': {
  1146. 'ini': '/etc/php/7.1/mods-available/xcache.ini',
  1147. 'defaults': {},
  1148. },
  1149. },
  1150. }, grain="os"),
  1151. 'fpm': {
  1152. 'service': {
  1153. 'enabled': True,
  1154. 'opts': {},
  1155. },
  1156. 'config': {
  1157. 'ini': {
  1158. 'opts': {},
  1159. 'settings': {},
  1160. },
  1161. 'conf': {
  1162. 'opts': {},
  1163. 'settings': {},
  1164. },
  1165. },
  1166. 'pools': {
  1167. 'default.conf': {
  1168. 'enabled': False,
  1169. 'opts': {},
  1170. },
  1171. },
  1172. },
  1173. 'hhvm': {
  1174. 'service': {
  1175. 'enabled': True,
  1176. 'opts': {},
  1177. },
  1178. 'config': {
  1179. 'server': {
  1180. 'opts': {},
  1181. 'settings': {},
  1182. },
  1183. 'php': {
  1184. 'opts': {},
  1185. 'settings': {},
  1186. },
  1187. },
  1188. },
  1189. 'cli': {
  1190. 'ini': {
  1191. 'opts': {},
  1192. 'settings': {},
  1193. }
  1194. },
  1195. 'apache2': {
  1196. 'ini': {
  1197. 'opts': {},
  1198. 'settings': {},
  1199. }
  1200. },
  1201. 'xcache': {
  1202. 'ini': {
  1203. 'defaults': {
  1204. 'xcache-common': {
  1205. 'extension': 'xcache.so',
  1206. },
  1207. 'xcache.admin': {
  1208. 'xcache.admin.enable_auth': 'On',
  1209. },
  1210. 'xcache': {
  1211. 'xcache.shm_scheme': '"mmap"',
  1212. 'xcache.size': '60M',
  1213. 'xcache.count': '1',
  1214. 'xcache.slots': '8K',
  1215. 'xcache.ttl': '0',
  1216. 'xcache.gc_interval': '0',
  1217. 'xcache.var_size': '4M',
  1218. 'xcache.var_count': '1',
  1219. 'xcache.var_slots': '8K',
  1220. 'xcache.var_ttl': '0',
  1221. 'xcache.var_maxttl': '0',
  1222. 'xcache.var_gc_interval': '300',
  1223. 'xcache.var_namespace_mode': '0',
  1224. 'xcache.var_namespace': '""',
  1225. 'xcache.readonly_protection': 'Off',
  1226. 'xcache.mmap_path': '"/dev/zero"',
  1227. 'xcache.coredump_directory': '""',
  1228. 'xcache.coredump_type': '0',
  1229. 'xcache.disable_on_crash': 'Off',
  1230. 'xcache.experimental': 'Off',
  1231. 'xcache.cacher': 'On',
  1232. 'xcache.stat': 'On',
  1233. 'xcache.optimizer': 'Off',
  1234. },
  1235. 'xcache.coverager': {
  1236. 'xcache.coverager': 'Off',
  1237. 'xcache.coverager_autostart': 'On',
  1238. 'xcache.coveragedump_directory': '""',
  1239. },
  1240. },
  1241. 'opts': {},
  1242. 'settings': {},
  1243. }
  1244. },
  1245. 'ini': {
  1246. 'defaults': {
  1247. 'PHP': {
  1248. 'allow_url_fopen': 'On',
  1249. 'allow_url_include': 'Off',
  1250. 'asp_tags': 'Off',
  1251. 'auto_globals_jit': 'On',
  1252. 'default_mimetype': '"text/html"',
  1253. 'default_socket_timeout': 60,
  1254. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  1255. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  1256. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  1257. 'display_errors': 'Off',
  1258. 'display_startup_errors': 'Off',
  1259. 'enable_dl': 'Off',
  1260. 'engine': 'On',
  1261. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  1262. 'expose_php': 'On',
  1263. 'file_uploads': 'On',
  1264. 'html_errors': 'On',
  1265. 'ignore_repeated_errors': 'Off',
  1266. 'ignore_repeated_source': 'Off',
  1267. 'implicit_flush': 'Off',
  1268. 'log_errors': 'On',
  1269. 'log_errors_max_len': 1024,
  1270. 'max_execution_time': 30,
  1271. 'max_file_uploads': 20,
  1272. 'max_input_nesting_level': 64,
  1273. 'max_input_time': 60,
  1274. 'max_input_vars': 1000,
  1275. 'memory_limit': '128M',
  1276. 'output_buffering': 4096,
  1277. 'post_max_size': '8M',
  1278. 'precision': 14,
  1279. 'register_argc_argv': 'Off',
  1280. 'report_memleaks': 'On',
  1281. 'request_order': 'GP',
  1282. 'serialize_precision': 17,
  1283. 'short_open_tag': 'Off',
  1284. 'track_errors': 'Off',
  1285. 'upload_max_filesize': '2M',
  1286. 'variables_order': 'GPCS',
  1287. 'zend.enable_gc': 'On',
  1288. 'zlib.output_compression': 'Off',
  1289. },
  1290. 'CLI Server': {
  1291. 'cli_server.color': 'On'
  1292. },
  1293. 'Date': {
  1294. 'date.timezone': 'America/New_York'
  1295. },
  1296. 'Pdo_mysql': {
  1297. 'pdo_mysql.cache_size': 2000
  1298. },
  1299. 'mail function': {
  1300. 'SMTP': 'localhost',
  1301. 'mail.add_x_header': 'On'
  1302. },
  1303. 'SQL': {
  1304. 'sql.safe_mode': 'Off'
  1305. },
  1306. 'ODBC': {
  1307. 'odbc.allow_persistent': 'On',
  1308. 'odbc.check_persistent': 'On',
  1309. 'odbc.max_persistent': '-1',
  1310. 'odbc.max_links': '-1',
  1311. 'odbc.defaultlrl': 4096,
  1312. 'odbc.defaultbinmode': 1
  1313. },
  1314. 'Interbase': {
  1315. 'ibase.allow_persistent': 1,
  1316. 'ibase.max_persistent': -1,
  1317. 'ibase.max_links': -1,
  1318. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  1319. 'ibase.dateformat': '"%Y-%m-%d"',
  1320. 'ibase.timeformat': '"%H:%M:%S"'
  1321. },
  1322. 'MySQL': {
  1323. 'mysql.allow_local_infile': 'On',
  1324. 'mysql.allow_persistent': 'On',
  1325. 'mysql.cache_size': '2000',
  1326. 'mysql.max_persistent': -1,
  1327. 'mysql.max_links': -1,
  1328. 'mysql.connect_timeout': 60,
  1329. 'mysql.trace_mode': 'Off'
  1330. },
  1331. 'MySQLi': {
  1332. 'mysqli.max_persistent': -1,
  1333. 'mysqli.allow_persistent': 'On',
  1334. 'mysqli.max_links': -1,
  1335. 'mysqli.cache_size': 2000,
  1336. 'mysqli.default_port': 3306,
  1337. 'mysqli.reconnect': 'Off'
  1338. },
  1339. 'mysqlnd': {
  1340. 'mysqlnd.collect_statistics': 'On',
  1341. 'mysqlnd.collect_memory_statistics': 'Off'
  1342. },
  1343. 'PostgreSQL': {
  1344. 'pgsql.allow_persistent': 'On',
  1345. 'pgsql.auto_reset_persistent': 'Off',
  1346. 'pgsql.max_persistent': -1,
  1347. 'pgsql.max_links': -1,
  1348. 'pgsql.ignore_notice': 0,
  1349. 'pgsql.log_notice': 0
  1350. },
  1351. 'Sybase-CT': {
  1352. 'sybct.allow_persistent': 'On',
  1353. 'sybct.max_persistent': -1,
  1354. 'sybct.max_links': -1,
  1355. 'sybct.min_server_severity': 10,
  1356. 'sybct.min_client_severity': 10
  1357. },
  1358. 'bcmath': {
  1359. 'bcmath.scale': 0
  1360. },
  1361. 'Session': {
  1362. 'session.save_handler': 'files',
  1363. 'session.use_strict_mode': 0,
  1364. 'session.use_cookies': 1,
  1365. 'session.use_only_cookies': 1,
  1366. 'session.name': 'PHPSESSID',
  1367. 'session.auto_start': 0,
  1368. 'session.cookie_lifetime': 0,
  1369. 'session.cookie_path': '/',
  1370. 'session.serialize_handler': 'php',
  1371. 'session.gc_probability': 0,
  1372. 'session.gc_divisor': 1000,
  1373. 'session.gc_maxlifetime': 1440,
  1374. 'session.bug_compat_42': 'Off',
  1375. 'session.bug_compat_warn': 'Off',
  1376. 'session.cache_limiter': 'nocache',
  1377. 'session.cache_expire': '180',
  1378. 'session.use_trans_sid': 0,
  1379. 'session.hash_function': 0,
  1380. 'session.hash_bits_per_character': 5,
  1381. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1382. },
  1383. 'MSSQL': {
  1384. 'mssql.allow_persistent': 'On',
  1385. 'mssql.max_persistent': -1,
  1386. 'mssql.max_links': -1,
  1387. 'mssql.min_error_severity': 10,
  1388. 'mssql.min_message_severity': 10,
  1389. 'mssql.compatibility_mode': 'Off',
  1390. 'mssql.secure_connection': 'Off'
  1391. },
  1392. 'Tidy': {
  1393. 'tidy.clean_output': 'Off'
  1394. },
  1395. 'soap': {
  1396. 'soap.wsdl_cache_enabled': 1,
  1397. 'soap.wsdl_cache_dir': '"/tmp"',
  1398. 'soap.wsdl_cache_ttl': 86400,
  1399. 'soap.wsdl_cache_limit': 5
  1400. },
  1401. 'ldap': {
  1402. 'ldap.max_links': -1
  1403. },
  1404. },
  1405. },
  1406. }, merge=True) %}
  1407. {%- elif salt['grains.get']('osrelease')|string >= '16.04' %}
  1408. {%- set php = salt['pillar.get']('php:ng', {
  1409. 'lookup': salt['grains.filter_by']({
  1410. 'Ubuntu': {
  1411. 'pkgs': {
  1412. 'adodb': 'libphp-adodb',
  1413. 'apache2': 'libapache2-mod-php',
  1414. 'apc': 'php',
  1415. 'apcu': 'php-apcu',
  1416. 'bcmath': 'php7.0-bcmath',
  1417. 'cache-lite': 'php-cache-lite',
  1418. 'cgi': 'php-cgi',
  1419. 'cli': 'php-cli',
  1420. 'console-table': 'php-console-table',
  1421. 'composer_bin': 'composer',
  1422. 'curl': 'php-curl',
  1423. 'dev': 'php7.0-dev',
  1424. 'fpm': 'php-fpm',
  1425. 'gd': 'php-gd',
  1426. 'geoip': 'php-geoip',
  1427. 'geshi': 'php-geshi',
  1428. 'gmp': 'php-gmp',
  1429. 'hhvm': 'hhvm',
  1430. 'imagick': 'php-imagick',
  1431. 'imap': 'php-imap',
  1432. 'intl': 'php-intl',
  1433. 'json': 'php-json',
  1434. 'ldap': 'php-ldap',
  1435. 'local_bin': '/usr/local/bin',
  1436. 'auth-sasl': 'php-auth-sasl',
  1437. 'mail': 'php-mail',
  1438. 'mbstring': 'php-mbstring',
  1439. 'mcrypt': 'php-mcrypt',
  1440. 'memcache': 'php-memcache',
  1441. 'memcached': 'php-memcached',
  1442. 'mongodb': 'php-mongodb',
  1443. 'mysql': 'php-mysql',
  1444. 'mysqlnd': 'php',
  1445. 'net-smtp': 'php-net-smtp',
  1446. 'net4': 'php-net-ipv4',
  1447. 'net6': 'php-net-ipv6',
  1448. 'oauth': 'php-oauth',
  1449. 'opcache': 'php7.0-opcache',
  1450. 'pear': 'php-pear',
  1451. 'pgsql': 'php-pgsql',
  1452. 'php': 'php',
  1453. 'phpenmod_command': 'phpenmod',
  1454. 'pspell': 'php-pspell',
  1455. 'redis': 'php-redis',
  1456. 'seclib': ['php-phpseclib', 'php-seclib'],
  1457. 'snmp': 'php-snmp',
  1458. 'soap': 'php-soap',
  1459. 'sqlite': 'php-sqlite3',
  1460. 'ssh2': 'php-ssh2',
  1461. 'suhosin': 'php',
  1462. 'sybase': 'php-sybase',
  1463. 'tcpdf': 'php-tcpdf',
  1464. 'temp_dir': '/tmp',
  1465. 'tidy': 'php7.0-tidy',
  1466. 'xcache': 'php',
  1467. 'xdebug': 'php-xdebug',
  1468. 'xml': 'php-xml',
  1469. 'xsl': 'php7.0-xsl',
  1470. 'zip': 'php-zip',
  1471. },
  1472. 'fpm': {
  1473. 'conf': '/etc/php/7.0/fpm/php-fpm.conf',
  1474. 'ini': '/etc/php/7.0/fpm/php.ini',
  1475. 'pools': '/etc/php/7.0/fpm/pool.d',
  1476. 'service': 'php7.0-fpm',
  1477. 'user': 'root',
  1478. 'group': 'root',
  1479. 'defaults': odict([
  1480. ('global', odict([
  1481. ('pid', '/var/run/php7.0-fpm.pid'),
  1482. ('error_log', '/var/log/php7.0-fpm.log'),
  1483. ])),
  1484. ('include', '/etc/php/7.0/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': '/etc/php/7.0/cli/php.ini',
  1513. },
  1514. 'apache2': {
  1515. 'ini': '/etc/php/7.0/apache2/php.ini',
  1516. },
  1517. 'xcache': {
  1518. 'ini': '/etc/php/7.0/mods-available/xcache.ini',
  1519. 'defaults': {},
  1520. },
  1521. },
  1522. }, grain="os"),
  1523. 'fpm': {
  1524. 'service': {
  1525. 'enabled': True,
  1526. 'opts': {},
  1527. },
  1528. 'config': {
  1529. 'ini': {
  1530. 'opts': {},
  1531. 'settings': {},
  1532. },
  1533. 'conf': {
  1534. 'opts': {},
  1535. 'settings': {},
  1536. },
  1537. },
  1538. 'pools': {
  1539. 'default.conf': {
  1540. 'enabled': False,
  1541. 'opts': {},
  1542. },
  1543. },
  1544. },
  1545. 'hhvm': {
  1546. 'service': {
  1547. 'enabled': True,
  1548. 'opts': {},
  1549. },
  1550. 'config': {
  1551. 'server': {
  1552. 'opts': {},
  1553. 'settings': {},
  1554. },
  1555. 'php': {
  1556. 'opts': {},
  1557. 'settings': {},
  1558. },
  1559. },
  1560. },
  1561. 'cli': {
  1562. 'ini': {
  1563. 'opts': {},
  1564. 'settings': {},
  1565. }
  1566. },
  1567. 'apache2': {
  1568. 'ini': {
  1569. 'opts': {},
  1570. 'settings': {},
  1571. }
  1572. },
  1573. 'xcache': {
  1574. 'ini': {
  1575. 'defaults': {
  1576. 'xcache-common': {
  1577. 'extension': 'xcache.so',
  1578. },
  1579. 'xcache.admin': {
  1580. 'xcache.admin.enable_auth': 'On',
  1581. },
  1582. 'xcache': {
  1583. 'xcache.shm_scheme': '"mmap"',
  1584. 'xcache.size': '60M',
  1585. 'xcache.count': '1',
  1586. 'xcache.slots': '8K',
  1587. 'xcache.ttl': '0',
  1588. 'xcache.gc_interval': '0',
  1589. 'xcache.var_size': '4M',
  1590. 'xcache.var_count': '1',
  1591. 'xcache.var_slots': '8K',
  1592. 'xcache.var_ttl': '0',
  1593. 'xcache.var_maxttl': '0',
  1594. 'xcache.var_gc_interval': '300',
  1595. 'xcache.var_namespace_mode': '0',
  1596. 'xcache.var_namespace': '""',
  1597. 'xcache.readonly_protection': 'Off',
  1598. 'xcache.mmap_path': '"/dev/zero"',
  1599. 'xcache.coredump_directory': '""',
  1600. 'xcache.coredump_type': '0',
  1601. 'xcache.disable_on_crash': 'Off',
  1602. 'xcache.experimental': 'Off',
  1603. 'xcache.cacher': 'On',
  1604. 'xcache.stat': 'On',
  1605. 'xcache.optimizer': 'Off',
  1606. },
  1607. 'xcache.coverager': {
  1608. 'xcache.coverager': 'Off',
  1609. 'xcache.coverager_autostart': 'On',
  1610. 'xcache.coveragedump_directory': '""',
  1611. },
  1612. },
  1613. 'opts': {},
  1614. 'settings': {},
  1615. }
  1616. },
  1617. 'ini': {
  1618. 'defaults': {
  1619. 'PHP': {
  1620. 'allow_url_fopen': 'On',
  1621. 'allow_url_include': 'Off',
  1622. 'asp_tags': 'Off',
  1623. 'auto_globals_jit': 'On',
  1624. 'default_mimetype': '"text/html"',
  1625. 'default_socket_timeout': 60,
  1626. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  1627. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  1628. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  1629. 'display_errors': 'Off',
  1630. 'display_startup_errors': 'Off',
  1631. 'enable_dl': 'Off',
  1632. 'engine': 'On',
  1633. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  1634. 'expose_php': 'On',
  1635. 'file_uploads': 'On',
  1636. 'html_errors': 'On',
  1637. 'ignore_repeated_errors': 'Off',
  1638. 'ignore_repeated_source': 'Off',
  1639. 'implicit_flush': 'Off',
  1640. 'log_errors': 'On',
  1641. 'log_errors_max_len': 1024,
  1642. 'max_execution_time': 30,
  1643. 'max_file_uploads': 20,
  1644. 'max_input_nesting_level': 64,
  1645. 'max_input_time': 60,
  1646. 'max_input_vars': 1000,
  1647. 'memory_limit': '128M',
  1648. 'output_buffering': 4096,
  1649. 'post_max_size': '8M',
  1650. 'precision': 14,
  1651. 'register_argc_argv': 'Off',
  1652. 'report_memleaks': 'On',
  1653. 'request_order': 'GP',
  1654. 'serialize_precision': 17,
  1655. 'short_open_tag': 'Off',
  1656. 'track_errors': 'Off',
  1657. 'upload_max_filesize': '2M',
  1658. 'variables_order': 'GPCS',
  1659. 'zend.enable_gc': 'On',
  1660. 'zlib.output_compression': 'Off',
  1661. },
  1662. 'CLI Server': {
  1663. 'cli_server.color': 'On'
  1664. },
  1665. 'Date': {
  1666. 'date.timezone': 'America/New_York'
  1667. },
  1668. 'Pdo_mysql': {
  1669. 'pdo_mysql.cache_size': 2000
  1670. },
  1671. 'mail function': {
  1672. 'SMTP': 'localhost',
  1673. 'mail.add_x_header': 'On'
  1674. },
  1675. 'SQL': {
  1676. 'sql.safe_mode': 'Off'
  1677. },
  1678. 'ODBC': {
  1679. 'odbc.allow_persistent': 'On',
  1680. 'odbc.check_persistent': 'On',
  1681. 'odbc.max_persistent': '-1',
  1682. 'odbc.max_links': '-1',
  1683. 'odbc.defaultlrl': 4096,
  1684. 'odbc.defaultbinmode': 1
  1685. },
  1686. 'Interbase': {
  1687. 'ibase.allow_persistent': 1,
  1688. 'ibase.max_persistent': -1,
  1689. 'ibase.max_links': -1,
  1690. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  1691. 'ibase.dateformat': '"%Y-%m-%d"',
  1692. 'ibase.timeformat': '"%H:%M:%S"'
  1693. },
  1694. 'MySQL': {
  1695. 'mysql.allow_local_infile': 'On',
  1696. 'mysql.allow_persistent': 'On',
  1697. 'mysql.cache_size': '2000',
  1698. 'mysql.max_persistent': -1,
  1699. 'mysql.max_links': -1,
  1700. 'mysql.connect_timeout': 60,
  1701. 'mysql.trace_mode': 'Off'
  1702. },
  1703. 'MySQLi': {
  1704. 'mysqli.max_persistent': -1,
  1705. 'mysqli.allow_persistent': 'On',
  1706. 'mysqli.max_links': -1,
  1707. 'mysqli.cache_size': 2000,
  1708. 'mysqli.default_port': 3306,
  1709. 'mysqli.reconnect': 'Off'
  1710. },
  1711. 'mysqlnd': {
  1712. 'mysqlnd.collect_statistics': 'On',
  1713. 'mysqlnd.collect_memory_statistics': 'Off'
  1714. },
  1715. 'PostgreSQL': {
  1716. 'pgsql.allow_persistent': 'On',
  1717. 'pgsql.auto_reset_persistent': 'Off',
  1718. 'pgsql.max_persistent': -1,
  1719. 'pgsql.max_links': -1,
  1720. 'pgsql.ignore_notice': 0,
  1721. 'pgsql.log_notice': 0
  1722. },
  1723. 'Sybase-CT': {
  1724. 'sybct.allow_persistent': 'On',
  1725. 'sybct.max_persistent': -1,
  1726. 'sybct.max_links': -1,
  1727. 'sybct.min_server_severity': 10,
  1728. 'sybct.min_client_severity': 10
  1729. },
  1730. 'bcmath': {
  1731. 'bcmath.scale': 0
  1732. },
  1733. 'Session': {
  1734. 'session.save_handler': 'files',
  1735. 'session.use_strict_mode': 0,
  1736. 'session.use_cookies': 1,
  1737. 'session.use_only_cookies': 1,
  1738. 'session.name': 'PHPSESSID',
  1739. 'session.auto_start': 0,
  1740. 'session.cookie_lifetime': 0,
  1741. 'session.cookie_path': '/',
  1742. 'session.serialize_handler': 'php',
  1743. 'session.gc_probability': 0,
  1744. 'session.gc_divisor': 1000,
  1745. 'session.gc_maxlifetime': 1440,
  1746. 'session.bug_compat_42': 'Off',
  1747. 'session.bug_compat_warn': 'Off',
  1748. 'session.cache_limiter': 'nocache',
  1749. 'session.cache_expire': '180',
  1750. 'session.use_trans_sid': 0,
  1751. 'session.hash_function': 0,
  1752. 'session.hash_bits_per_character': 5,
  1753. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  1754. },
  1755. 'MSSQL': {
  1756. 'mssql.allow_persistent': 'On',
  1757. 'mssql.max_persistent': -1,
  1758. 'mssql.max_links': -1,
  1759. 'mssql.min_error_severity': 10,
  1760. 'mssql.min_message_severity': 10,
  1761. 'mssql.compatibility_mode': 'Off',
  1762. 'mssql.secure_connection': 'Off'
  1763. },
  1764. 'Tidy': {
  1765. 'tidy.clean_output': 'Off'
  1766. },
  1767. 'soap': {
  1768. 'soap.wsdl_cache_enabled': 1,
  1769. 'soap.wsdl_cache_dir': '"/tmp"',
  1770. 'soap.wsdl_cache_ttl': 86400,
  1771. 'soap.wsdl_cache_limit': 5
  1772. },
  1773. 'ldap': {
  1774. 'ldap.max_links': -1
  1775. },
  1776. },
  1777. },
  1778. }, merge=True) %}
  1779. {%- else %}
  1780. {%- set php = salt['pillar.get']('php:ng', {
  1781. 'lookup': salt['grains.filter_by']({
  1782. 'Ubuntu': {
  1783. 'pkgs': {
  1784. 'adodb': 'php5-adodb',
  1785. 'apache2': 'libapache2-mod-php5',
  1786. 'apc': 'php-apc',
  1787. 'apcu': 'php5-apcu',
  1788. 'bcmath': 'php5',
  1789. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
  1790. 'cache-lite': 'php-cache-lite',
  1791. 'cgi': 'php5-cgi',
  1792. 'cli': 'php5-cli',
  1793. 'composer_bin': 'composer',
  1794. 'console-table': 'php-console-table',
  1795. 'curl': 'php5-curl',
  1796. 'dev': ['php5-dev','build-essential'],
  1797. 'ext_conf_path': salt['grains.filter_by']({
  1798. 'precise': '/etc/php5/conf.d',
  1799. 'default': '/etc/php5/mods-available',
  1800. }, grain='oscodename'),
  1801. 'fpm': 'php5-fpm',
  1802. 'gd': 'php5-gd',
  1803. 'gearman': 'php5-gearman',
  1804. 'geoip': 'php5-geoip',
  1805. 'geshi': 'php-geshi',
  1806. 'gettext': 'php-gettext',
  1807. 'gmp': 'php5-gmp',
  1808. 'hhvm': 'hhvm',
  1809. 'imagick': 'php5-imagick',
  1810. 'imap': 'php5-imap',
  1811. 'intl': 'php5-intl',
  1812. 'json': 'php5-json',
  1813. 'ldap': 'php5-ldap',
  1814. 'local_bin': '/usr/local/bin',
  1815. 'auth-sasl': 'php-auth-sasl',
  1816. 'mail': 'php-mail',
  1817. 'mbstring': 'php5',
  1818. 'mcrypt': 'php5-mcrypt',
  1819. 'mdb2': 'php-mdb2',
  1820. 'mdb2-driver-mysql': 'php-mdb2-driver-mysql',
  1821. 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql',
  1822. 'memcache': 'php5-memcache',
  1823. 'memcached': 'php5-memcached',
  1824. 'mongodb': salt['grains.filter_by']({
  1825. 'trusty': 'php5-mongo',
  1826. 'default': '',
  1827. }, grain='oscodename'),
  1828. 'mysql': 'php5-mysql',
  1829. 'mysqlnd': 'php5-mysqlnd',
  1830. 'net-smtp': 'php-net-smtp',
  1831. 'net4': 'php-net-ipv4',
  1832. 'net6': 'php-net-ipv6',
  1833. 'oauth': 'php5-oauth',
  1834. 'opcache': 'php5',
  1835. 'pear': 'php-pear',
  1836. 'pgsql': 'php5-pgsql',
  1837. 'php': 'php5',
  1838. 'phpenmod_command': salt['grains.filter_by']({
  1839. 'precise': 'true',
  1840. 'default': 'php5enmod',
  1841. }, grain='oscodename'),
  1842. 'pspell': 'php5-pspell',
  1843. 'redis': 'php5-redis',
  1844. 'seclib': 'php-seclib',
  1845. 'snmp': 'php5-snmp',
  1846. 'soap': 'php-soap',
  1847. 'sqlite': 'php5-sqlite',
  1848. 'ssh2': 'libssh2-php',
  1849. 'suhosin5_ext': 'suhosin.so',
  1850. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  1851. 'suhosin7_ext': 'suhosin7.so',
  1852. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  1853. 'svn': 'php5-svn',
  1854. 'tcpdf': 'php-tcpdf',
  1855. 'tidy': 'php5-tidy',
  1856. 'temp_dir': '/tmp',
  1857. 'xcache': 'php5-xcache',
  1858. 'xdebug': 'php5-xdebug',
  1859. 'xml': 'php5',
  1860. 'xsl': 'php5-xsl',
  1861. 'zip': 'php5',
  1862. },
  1863. 'fpm': {
  1864. 'conf': '/etc/php5/fpm/php-fpm.conf',
  1865. 'ini': '/etc/php5/fpm/php.ini',
  1866. 'pools': '/etc/php5/fpm/pool.d',
  1867. 'service': 'php5-fpm',
  1868. 'user': 'root',
  1869. 'group': 'root',
  1870. 'defaults': odict([
  1871. ('global', odict([
  1872. ('pid', '/var/run/php5-fpm.pid'),
  1873. ('error_log', '/var/log/php5-fpm.log'),
  1874. ])),
  1875. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  1876. ]),
  1877. },
  1878. 'hhvm': {
  1879. 'conf': '/etc/hhvm/server.ini',
  1880. 'ini': '/etc/hhvm/php.ini',
  1881. 'service': 'hhvm',
  1882. 'defaults': {},
  1883. 'server': odict([
  1884. ('pid', '/var/run/hhvm/pid'),
  1885. ('hhvm.server.port', '9000'),
  1886. ('hhvm.server.type', 'fastcgi'),
  1887. ('hhvm.server.default_document', 'index.php'),
  1888. ('hhvm.log.use_log_file', 'true'),
  1889. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  1890. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  1891. ]),
  1892. 'php': odict([
  1893. ('session.save_handler', 'files'),
  1894. ('session.save_path', '/var/lib/hhvm/sessions'),
  1895. ('session.gc_maxlifetime', '1440'),
  1896. ('hhvm.log.level', 'Warning'),
  1897. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  1898. ('hhvm.log.runtime_error_reporting_level', '8191'),
  1899. ('hhvm.mysql.typed_results', 'false'),
  1900. ]),
  1901. },
  1902. 'cli': {
  1903. 'ini': '/etc/php5/cli/php.ini',
  1904. },
  1905. 'apache2': {
  1906. 'ini': '/etc/php5/apache2/php.ini',
  1907. },
  1908. 'xcache': {
  1909. 'ini': '/etc/php5/mods-available/xcache.ini',
  1910. 'defaults': {},
  1911. },
  1912. },
  1913. }, grain="os"),
  1914. 'fpm': {
  1915. 'service': {
  1916. 'enabled': True,
  1917. 'opts': {},
  1918. },
  1919. 'config': {
  1920. 'ini': {
  1921. 'opts': {},
  1922. 'settings': {},
  1923. },
  1924. 'conf': {
  1925. 'opts': {},
  1926. 'settings': {},
  1927. },
  1928. },
  1929. 'pools': {
  1930. 'default.conf': {
  1931. 'enabled': False,
  1932. 'opts': {},
  1933. },
  1934. },
  1935. },
  1936. 'hhvm': {
  1937. 'service': {
  1938. 'enabled': True,
  1939. 'opts': {},
  1940. },
  1941. 'config': {
  1942. 'server': {
  1943. 'opts': {},
  1944. 'settings': {},
  1945. },
  1946. 'php': {
  1947. 'opts': {},
  1948. 'settings': {},
  1949. },
  1950. },
  1951. },
  1952. 'cli': {
  1953. 'ini': {
  1954. 'opts': {},
  1955. 'settings': {},
  1956. }
  1957. },
  1958. 'apache2': {
  1959. 'ini': {
  1960. 'opts': {},
  1961. 'settings': {},
  1962. }
  1963. },
  1964. 'xcache': {
  1965. 'ini': {
  1966. 'defaults': {
  1967. 'xcache-common': {
  1968. 'extension': 'xcache.so',
  1969. },
  1970. 'xcache.admin': {
  1971. 'xcache.admin.enable_auth': 'On',
  1972. },
  1973. 'xcache': {
  1974. 'xcache.shm_scheme': '"mmap"',
  1975. 'xcache.size': '60M',
  1976. 'xcache.count': '1',
  1977. 'xcache.slots': '8K',
  1978. 'xcache.ttl': '0',
  1979. 'xcache.gc_interval': '0',
  1980. 'xcache.var_size': '4M',
  1981. 'xcache.var_count': '1',
  1982. 'xcache.var_slots': '8K',
  1983. 'xcache.var_ttl': '0',
  1984. 'xcache.var_maxttl': '0',
  1985. 'xcache.var_gc_interval': '300',
  1986. 'xcache.var_namespace_mode': '0',
  1987. 'xcache.var_namespace': '""',
  1988. 'xcache.readonly_protection': 'Off',
  1989. 'xcache.mmap_path': '"/dev/zero"',
  1990. 'xcache.coredump_directory': '""',
  1991. 'xcache.coredump_type': '0',
  1992. 'xcache.disable_on_crash': 'Off',
  1993. 'xcache.experimental': 'Off',
  1994. 'xcache.cacher': 'On',
  1995. 'xcache.stat': 'On',
  1996. 'xcache.optimizer': 'Off',
  1997. },
  1998. 'xcache.coverager': {
  1999. 'xcache.coverager': 'Off',
  2000. 'xcache.coverager_autostart': 'On',
  2001. 'xcache.coveragedump_directory': '""',
  2002. },
  2003. },
  2004. 'opts': {},
  2005. 'settings': {},
  2006. }
  2007. },
  2008. 'ini': {
  2009. 'defaults': {
  2010. 'PHP': {
  2011. 'allow_url_fopen': 'On',
  2012. 'allow_url_include': 'Off',
  2013. 'asp_tags': 'Off',
  2014. 'auto_globals_jit': 'On',
  2015. 'default_mimetype': '"text/html"',
  2016. 'default_socket_timeout': 60,
  2017. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  2018. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  2019. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  2020. 'display_errors': 'Off',
  2021. 'display_startup_errors': 'Off',
  2022. 'enable_dl': 'Off',
  2023. 'engine': 'On',
  2024. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  2025. 'expose_php': 'On',
  2026. 'file_uploads': 'On',
  2027. 'html_errors': 'On',
  2028. 'ignore_repeated_errors': 'Off',
  2029. 'ignore_repeated_source': 'Off',
  2030. 'implicit_flush': 'Off',
  2031. 'log_errors': 'On',
  2032. 'log_errors_max_len': 1024,
  2033. 'max_execution_time': 30,
  2034. 'max_file_uploads': 20,
  2035. 'max_input_nesting_level': 64,
  2036. 'max_input_time': 60,
  2037. 'max_input_vars': 1000,
  2038. 'memory_limit': '128M',
  2039. 'output_buffering': 4096,
  2040. 'post_max_size': '8M',
  2041. 'precision': 14,
  2042. 'register_argc_argv': 'Off',
  2043. 'report_memleaks': 'On',
  2044. 'request_order': 'GP',
  2045. 'serialize_precision': 17,
  2046. 'short_open_tag': 'Off',
  2047. 'track_errors': 'Off',
  2048. 'upload_max_filesize': '2M',
  2049. 'variables_order': 'GPCS',
  2050. 'zend.enable_gc': 'On',
  2051. 'zlib.output_compression': 'Off',
  2052. },
  2053. 'CLI Server': {
  2054. 'cli_server.color': 'On'
  2055. },
  2056. 'Date': {
  2057. 'date.timezone': 'America/New_York'
  2058. },
  2059. 'Pdo_mysql': {
  2060. 'pdo_mysql.cache_size': 2000
  2061. },
  2062. 'mail function': {
  2063. 'SMTP': 'localhost',
  2064. 'mail.add_x_header': 'On'
  2065. },
  2066. 'SQL': {
  2067. 'sql.safe_mode': 'Off'
  2068. },
  2069. 'ODBC': {
  2070. 'odbc.allow_persistent': 'On',
  2071. 'odbc.check_persistent': 'On',
  2072. 'odbc.max_persistent': '-1',
  2073. 'odbc.max_links': '-1',
  2074. 'odbc.defaultlrl': 4096,
  2075. 'odbc.defaultbinmode': 1
  2076. },
  2077. 'Interbase': {
  2078. 'ibase.allow_persistent': 1,
  2079. 'ibase.max_persistent': -1,
  2080. 'ibase.max_links': -1,
  2081. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  2082. 'ibase.dateformat': '"%Y-%m-%d"',
  2083. 'ibase.timeformat': '"%H:%M:%S"'
  2084. },
  2085. 'MySQL': {
  2086. 'mysql.allow_local_infile': 'On',
  2087. 'mysql.allow_persistent': 'On',
  2088. 'mysql.cache_size': '2000',
  2089. 'mysql.max_persistent': -1,
  2090. 'mysql.max_links': -1,
  2091. 'mysql.connect_timeout': 60,
  2092. 'mysql.trace_mode': 'Off'
  2093. },
  2094. 'MySQLi': {
  2095. 'mysqli.max_persistent': -1,
  2096. 'mysqli.allow_persistent': 'On',
  2097. 'mysqli.max_links': -1,
  2098. 'mysqli.cache_size': 2000,
  2099. 'mysqli.default_port': 3306,
  2100. 'mysqli.reconnect': 'Off'
  2101. },
  2102. 'mysqlnd': {
  2103. 'mysqlnd.collect_statistics': 'On',
  2104. 'mysqlnd.collect_memory_statistics': 'Off'
  2105. },
  2106. 'PostgreSQL': {
  2107. 'pgsql.allow_persistent': 'On',
  2108. 'pgsql.auto_reset_persistent': 'Off',
  2109. 'pgsql.max_persistent': -1,
  2110. 'pgsql.max_links': -1,
  2111. 'pgsql.ignore_notice': 0,
  2112. 'pgsql.log_notice': 0
  2113. },
  2114. 'Sybase-CT': {
  2115. 'sybct.allow_persistent': 'On',
  2116. 'sybct.max_persistent': -1,
  2117. 'sybct.max_links': -1,
  2118. 'sybct.min_server_severity': 10,
  2119. 'sybct.min_client_severity': 10
  2120. },
  2121. 'bcmath': {
  2122. 'bcmath.scale': 0
  2123. },
  2124. 'Session': {
  2125. 'session.save_handler': 'files',
  2126. 'session.use_strict_mode': 0,
  2127. 'session.use_cookies': 1,
  2128. 'session.use_only_cookies': 1,
  2129. 'session.name': 'PHPSESSID',
  2130. 'session.auto_start': 0,
  2131. 'session.cookie_lifetime': 0,
  2132. 'session.cookie_path': '/',
  2133. 'session.serialize_handler': 'php',
  2134. 'session.gc_probability': 0,
  2135. 'session.gc_divisor': 1000,
  2136. 'session.gc_maxlifetime': 1440,
  2137. 'session.bug_compat_42': 'Off',
  2138. 'session.bug_compat_warn': 'Off',
  2139. 'session.cache_limiter': 'nocache',
  2140. 'session.cache_expire': '180',
  2141. 'session.use_trans_sid': 0,
  2142. 'session.hash_function': 0,
  2143. 'session.hash_bits_per_character': 5,
  2144. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  2145. },
  2146. 'MSSQL': {
  2147. 'mssql.allow_persistent': 'On',
  2148. 'mssql.max_persistent': -1,
  2149. 'mssql.max_links': -1,
  2150. 'mssql.min_error_severity': 10,
  2151. 'mssql.min_message_severity': 10,
  2152. 'mssql.compatibility_mode': 'Off',
  2153. 'mssql.secure_connection': 'Off'
  2154. },
  2155. 'Tidy': {
  2156. 'tidy.clean_output': 'Off'
  2157. },
  2158. 'soap': {
  2159. 'soap.wsdl_cache_enabled': 1,
  2160. 'soap.wsdl_cache_dir': '"/tmp"',
  2161. 'soap.wsdl_cache_ttl': 86400,
  2162. 'soap.wsdl_cache_limit': 5
  2163. },
  2164. 'ldap': {
  2165. 'ldap.max_links': -1
  2166. },
  2167. },
  2168. },
  2169. }, merge=True) %}
  2170. {%- endif %}
  2171. {%- endif %}
  2172. {%- elif salt['grains.get']('os') == "Debian" %}
  2173. {%- if phpng_version|string == '5' %}
  2174. {%- set confdir = '/etc/php5' %}
  2175. {%- else %}
  2176. {%- set confdir = '/etc/php/' + phpng_version %}
  2177. {%- endif %}
  2178. {%- set php = salt['pillar.get']('php:ng', {
  2179. 'lookup': salt['grains.filter_by']({
  2180. 'Debian': {
  2181. 'pkgs': {
  2182. 'adodb': 'libphp-adodb',
  2183. 'apache2': 'libapache2-mod-php' + phpng_version,
  2184. 'apc': 'php-apcu',
  2185. 'apcu': 'php-apcu-bc',
  2186. 'bcmath': 'php' + phpng_version + '-bcmath',
  2187. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
  2188. 'cache-lite': 'php-cache-lite',
  2189. 'cgi': 'php' + phpng_version + '-cgi',
  2190. 'cli': 'php' + phpng_version + '-cli',
  2191. 'composer_bin': 'composer',
  2192. 'console-table': 'php-console-table',
  2193. 'curl': 'php' + phpng_version + '-curl',
  2194. 'dev': 'php' + phpng_version + '-dev',
  2195. 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available',
  2196. 'fpm': 'php' + phpng_version + '-fpm',
  2197. 'gd': 'php' + phpng_version + '-gd',
  2198. 'gearman': 'php-gearman',
  2199. 'geoip': 'php-geoip',
  2200. 'geshi': 'php-geshi',
  2201. 'gettext': 'php' + phpng_version,
  2202. 'gmp': 'php' + phpng_version + '-gmp',
  2203. 'hhvm': 'hhvm',
  2204. 'igbinary': 'php-igbinary',
  2205. 'imagick': 'php-imagick',
  2206. 'imap': 'php' + phpng_version + '-imap',
  2207. 'intl': 'php' + phpng_version + '-intl',
  2208. 'json': 'php' + phpng_version + '-json',
  2209. 'ldap': 'php' + phpng_version + '-ldap',
  2210. 'local_bin': '/usr/local/bin',
  2211. 'auth-sasl': 'php-auth-sasl',
  2212. 'mail': 'php-mail',
  2213. 'mbstring': 'php' + phpng_version + '-mbstring',
  2214. 'mcrypt': 'php' + phpng_version + '-mcrypt',
  2215. 'memcache': 'php-memcache',
  2216. 'memcached': 'php-memcached',
  2217. 'mongo': 'php-mongo',
  2218. 'mongodb': 'php-mongodb',
  2219. 'msgpack': 'php-msgpack',
  2220. 'mysql': 'php' + phpng_version + '-mysql',
  2221. 'mysqlnd': 'php' + phpng_version + '-mysql',
  2222. 'net-smtp': 'php-net-smtp',
  2223. 'net4': 'php-net-ipv4',
  2224. 'net6': 'php-net-ipv6',
  2225. 'oauth': 'php-oauth',
  2226. 'opcache': 'php' + phpng_version + '-opcache',
  2227. 'pear': 'php-pear',
  2228. 'pgsql': 'php' + phpng_version + '-pgsql',
  2229. 'php': 'php' + phpng_version,
  2230. 'phpenmod_command': 'phpenmod -v' + phpng_version,
  2231. 'pspell': 'php' + phpng_version + '-pspell',
  2232. 'readline': 'php' + phpng_version + '-readline',
  2233. 'redis': 'php-redis',
  2234. 'seclib': ['php-phpseclib', 'php-seclib'],
  2235. 'snmp': 'php' + phpng_version + '-snmp',
  2236. 'soap': 'php' + phpng_version + '-soap',
  2237. 'ssh2': 'php-ssh2',
  2238. 'sqlite': 'php' + phpng_version + '-sqlite3',
  2239. 'suhosin5_ext': 'suhosin.so',
  2240. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  2241. 'suhosin7_ext': 'suhosin7.so',
  2242. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  2243. 'sybase': 'php' + phpng_version + '-sybase',
  2244. 'tcpdf': 'php-tcpdf',
  2245. 'temp_dir': '/tmp',
  2246. 'tidy': 'php' + phpng_version + '-tidy',
  2247. 'xdebug': 'php' + phpng_version + '-xdebug',
  2248. 'xml': 'php' + phpng_version + '-xml',
  2249. 'xsl': 'php' + phpng_version + '-xsl',
  2250. 'zip': 'php' + phpng_version + '-zip',
  2251. },
  2252. 'fpm': {
  2253. 'conf': confdir + '/fpm/php-fpm.conf',
  2254. 'ini': confdir + '/fpm/php.ini',
  2255. 'pools': confdir + '/fpm/pool.d',
  2256. 'service': 'php' + phpng_version + '-fpm',
  2257. 'user': 'root',
  2258. 'group': 'root',
  2259. 'defaults': odict([
  2260. ('global', odict([
  2261. ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
  2262. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  2263. ])),
  2264. ('include', confdir + '/fpm/pool.d/*.conf'),
  2265. ]),
  2266. },
  2267. 'hhvm': {
  2268. 'conf': '/etc/hhvm/server.ini',
  2269. 'ini': '/etc/hhvm/php.ini',
  2270. 'service': 'hhvm',
  2271. 'defaults': {},
  2272. 'server': odict([
  2273. ('pid', '/var/run/hhvm/pid'),
  2274. ('hhvm.server.port', '9000'),
  2275. ('hhvm.server.type', 'fastcgi'),
  2276. ('hhvm.server.default_document', 'index.php'),
  2277. ('hhvm.log.use_log_file', 'true'),
  2278. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  2279. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  2280. ]),
  2281. 'php': odict([
  2282. ('session.save_handler', 'files'),
  2283. ('session.save_path', '/var/lib/hhvm/sessions'),
  2284. ('session.gc_maxlifetime', '1440'),
  2285. ('hhvm.log.level', 'Warning'),
  2286. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  2287. ('hhvm.log.runtime_error_reporting_level', '8191'),
  2288. ('hhvm.mysql.typed_results', 'false'),
  2289. ]),
  2290. },
  2291. 'cli': {
  2292. 'ini': confdir + '/cli/php.ini',
  2293. },
  2294. 'apache2': {
  2295. 'ini': confdir + '/apache2/php.ini',
  2296. },
  2297. },
  2298. }),
  2299. 'fpm': {
  2300. 'service': {
  2301. 'enabled': True,
  2302. 'opts': {},
  2303. },
  2304. 'config': {
  2305. 'ini': {
  2306. 'opts': {},
  2307. 'settings': {},
  2308. },
  2309. 'conf': {
  2310. 'opts': {},
  2311. 'settings': {},
  2312. },
  2313. },
  2314. 'pools': {},
  2315. },
  2316. 'hhvm': {
  2317. 'service': {
  2318. 'enabled': True,
  2319. 'opts': {},
  2320. },
  2321. 'config': {
  2322. 'server': {
  2323. 'opts': {},
  2324. 'settings': {},
  2325. },
  2326. 'php': {
  2327. 'opts': {},
  2328. 'settings': {},
  2329. },
  2330. },
  2331. },
  2332. 'cli': {
  2333. 'ini': {
  2334. 'opts': {},
  2335. 'settings': {},
  2336. }
  2337. },
  2338. 'apache2': {
  2339. 'ini': {
  2340. 'opts': {},
  2341. 'settings': {},
  2342. }
  2343. },
  2344. 'ini': {
  2345. 'defaults': {
  2346. 'PHP': {
  2347. 'allow_url_fopen': 'On',
  2348. 'allow_url_include': 'Off',
  2349. 'asp_tags': 'Off',
  2350. 'auto_globals_jit': 'On',
  2351. 'default_mimetype': '"text/html"',
  2352. 'default_socket_timeout': 60,
  2353. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  2354. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  2355. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  2356. 'display_errors': 'Off',
  2357. 'display_startup_errors': 'Off',
  2358. 'enable_dl': 'Off',
  2359. 'engine': 'On',
  2360. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  2361. 'expose_php': 'On',
  2362. 'file_uploads': 'On',
  2363. 'html_errors': 'On',
  2364. 'ignore_repeated_errors': 'Off',
  2365. 'ignore_repeated_source': 'Off',
  2366. 'implicit_flush': 'Off',
  2367. 'log_errors': 'On',
  2368. 'log_errors_max_len': 1024,
  2369. 'max_execution_time': 30,
  2370. 'max_file_uploads': 20,
  2371. 'max_input_nesting_level': 64,
  2372. 'max_input_time': 60,
  2373. 'max_input_vars': 1000,
  2374. 'memory_limit': '128M',
  2375. 'output_buffering': 4096,
  2376. 'post_max_size': '8M',
  2377. 'precision': 14,
  2378. 'register_argc_argv': 'Off',
  2379. 'report_memleaks': 'On',
  2380. 'request_order': 'GP',
  2381. 'serialize_precision': 17,
  2382. 'short_open_tag': 'Off',
  2383. 'track_errors': 'Off',
  2384. 'upload_max_filesize': '2M',
  2385. 'variables_order': 'GPCS',
  2386. 'zend.enable_gc': 'On',
  2387. 'zlib.output_compression': 'Off',
  2388. },
  2389. 'CLI Server': {
  2390. 'cli_server.color': 'On'
  2391. },
  2392. 'Date': {
  2393. 'date.timezone': 'America/New_York'
  2394. },
  2395. 'Pdo_mysql': {
  2396. 'pdo_mysql.cache_size': 2000
  2397. },
  2398. 'mail function': {
  2399. 'SMTP': 'localhost',
  2400. 'mail.add_x_header': 'On'
  2401. },
  2402. 'SQL': {
  2403. 'sql.safe_mode': 'Off'
  2404. },
  2405. 'ODBC': {
  2406. 'odbc.allow_persistent': 'On',
  2407. 'odbc.check_persistent': 'On',
  2408. 'odbc.max_persistent': '-1',
  2409. 'odbc.max_links': '-1',
  2410. 'odbc.defaultlrl': 4096,
  2411. 'odbc.defaultbinmode': 1
  2412. },
  2413. 'Interbase': {
  2414. 'ibase.allow_persistent': 1,
  2415. 'ibase.max_persistent': -1,
  2416. 'ibase.max_links': -1,
  2417. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  2418. 'ibase.dateformat': '"%Y-%m-%d"',
  2419. 'ibase.timeformat': '"%H:%M:%S"'
  2420. },
  2421. 'MySQL': {
  2422. 'mysql.allow_local_infile': 'On',
  2423. 'mysql.allow_persistent': 'On',
  2424. 'mysql.cache_size': '2000',
  2425. 'mysql.max_persistent': -1,
  2426. 'mysql.max_links': -1,
  2427. 'mysql.connect_timeout': 60,
  2428. 'mysql.trace_mode': 'Off'
  2429. },
  2430. 'MySQLi': {
  2431. 'mysqli.max_persistent': -1,
  2432. 'mysqli.allow_persistent': 'On',
  2433. 'mysqli.max_links': -1,
  2434. 'mysqli.cache_size': 2000,
  2435. 'mysqli.default_port': 3306,
  2436. 'mysqli.reconnect': 'Off'
  2437. },
  2438. 'mysqlnd': {
  2439. 'mysqlnd.collect_statistics': 'On',
  2440. 'mysqlnd.collect_memory_statistics': 'Off'
  2441. },
  2442. 'PostgreSQL': {
  2443. 'pgsql.allow_persistent': 'On',
  2444. 'pgsql.auto_reset_persistent': 'Off',
  2445. 'pgsql.max_persistent': -1,
  2446. 'pgsql.max_links': -1,
  2447. 'pgsql.ignore_notice': 0,
  2448. 'pgsql.log_notice': 0
  2449. },
  2450. 'Sybase-CT': {
  2451. 'sybct.allow_persistent': 'On',
  2452. 'sybct.max_persistent': -1,
  2453. 'sybct.max_links': -1,
  2454. 'sybct.min_server_severity': 10,
  2455. 'sybct.min_client_severity': 10
  2456. },
  2457. 'bcmath': {
  2458. 'bcmath.scale': 0
  2459. },
  2460. 'Session': {
  2461. 'session.save_handler': 'files',
  2462. 'session.use_strict_mode': 0,
  2463. 'session.use_cookies': 1,
  2464. 'session.use_only_cookies': 1,
  2465. 'session.name': 'PHPSESSID',
  2466. 'session.auto_start': 0,
  2467. 'session.cookie_lifetime': 0,
  2468. 'session.cookie_path': '/',
  2469. 'session.serialize_handler': 'php',
  2470. 'session.gc_probability': 0,
  2471. 'session.gc_divisor': 1000,
  2472. 'session.gc_maxlifetime': 1440,
  2473. 'session.bug_compat_42': 'Off',
  2474. 'session.bug_compat_warn': 'Off',
  2475. 'session.cache_limiter': 'nocache',
  2476. 'session.cache_expire': '180',
  2477. 'session.use_trans_sid': 0,
  2478. 'session.hash_function': 0,
  2479. 'session.hash_bits_per_character': 5,
  2480. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  2481. },
  2482. 'MSSQL': {
  2483. 'mssql.allow_persistent': 'On',
  2484. 'mssql.max_persistent': -1,
  2485. 'mssql.max_links': -1,
  2486. 'mssql.min_error_severity': 10,
  2487. 'mssql.min_message_severity': 10,
  2488. 'mssql.compatibility_mode': 'Off',
  2489. 'mssql.secure_connection': 'Off'
  2490. },
  2491. 'Tidy': {
  2492. 'tidy.clean_output': 'Off'
  2493. },
  2494. 'soap': {
  2495. 'soap.wsdl_cache_enabled': 1,
  2496. 'soap.wsdl_cache_dir': '"/tmp"',
  2497. 'soap.wsdl_cache_ttl': 86400,
  2498. 'soap.wsdl_cache_limit': 5
  2499. },
  2500. 'ldap': {
  2501. 'ldap.max_links': -1
  2502. },
  2503. },
  2504. },
  2505. }, merge=True) %}
  2506. {%- else %}
  2507. {%- set useversion = phpng_version | replace(".", "-") -%}
  2508. {#- Red Hat Softwarecollection prefix lookup belongs to the Red Hat part
  2509. further down but has to go here due to Jinja parsing rules. -#}
  2510. {%- if salt['pillar.get']('php:use_scl_repo', False) -%}
  2511. {%- set rh_prefix = 'rh-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%}
  2512. {%- set sclo_prefix = 'sclo-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%}
  2513. {%- set path_suffix = 'opt/rh/rh-php{}/'.format(salt['pillar.get']('php:scl_php_version', '')) -%}
  2514. {%- else -%}
  2515. {%- set rh_prefix = '' -%}
  2516. {%- set sclo_prefix = '' -%}
  2517. {%- set path_suffix = '' -%}
  2518. {%- endif -%}
  2519. {%- set php = salt['pillar.get']('php:ng', {
  2520. 'lookup': salt['grains.filter_by']({
  2521. 'Debian': {
  2522. 'pkgs': {
  2523. 'adodb': 'php5-adodb',
  2524. 'apache2': 'libapache2-mod-php5',
  2525. 'apc': 'php-apc',
  2526. 'apcu': 'php5-apcu',
  2527. 'bcmath': 'php5',
  2528. 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
  2529. 'cache-lite': 'php-cache-lite',
  2530. 'cgi': 'php5-cgi',
  2531. 'cli': 'php5-cli',
  2532. 'console-table': 'php-console-table',
  2533. 'composer_bin': 'composer',
  2534. 'curl': 'php5-curl',
  2535. 'dev': ['php5-dev','build-essential'],
  2536. 'ext_conf_path': '/etc/php5/mods-available',
  2537. 'fpm': 'php5-fpm',
  2538. 'gd': 'php5-gd',
  2539. 'gearman': 'php5-gearman',
  2540. 'geoip': 'php5-geoip',
  2541. 'geshi': 'php-geshi',
  2542. 'gettext': 'php-gettext',
  2543. 'gmp': 'php5-gmp',
  2544. 'hhvm': 'hhvm',
  2545. 'imagick': 'php5-imagick',
  2546. 'imap': 'php5-imap',
  2547. 'intl': 'php5-intl',
  2548. 'json': 'php5-json',
  2549. 'ldap': 'php5-ldap',
  2550. 'local_bin': '/usr/local/bin',
  2551. 'auth-sasl': 'php-auth-sasl',
  2552. 'mail': 'php-mail',
  2553. 'mbstring': 'php5',
  2554. 'mcrypt': 'php5-mcrypt',
  2555. 'mdb2': 'php-mdb2',
  2556. 'mdb2-driver-mysql': 'php-mdb2-driver-mysql',
  2557. 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql',
  2558. 'memcache': 'php5-memcache',
  2559. 'memcached': 'php5-memcached',
  2560. 'mysql': 'php5-mysql',
  2561. 'mysqlnd': 'php5-mysqlnd',
  2562. 'net-smtp': 'php-net-smtp',
  2563. 'net4': 'php-net-ipv4',
  2564. 'net6': 'php-net-ipv6',
  2565. 'oauth': 'php5-oauth',
  2566. 'opcache': 'php5',
  2567. 'pear': 'php-pear',
  2568. 'pgsql': 'php5-pgsql',
  2569. 'php': 'php5',
  2570. 'phpenmod_command': 'php5enmod',
  2571. 'pspell': 'php5-pspell',
  2572. 'redis': 'php5-redis',
  2573. 'seclib': 'php-seclib',
  2574. 'snmp': 'php5-snmp',
  2575. 'soap': 'php-soap',
  2576. 'sqlite': 'php5-sqlite',
  2577. 'ssh2': 'php5-ssh2',
  2578. 'suhosin5_ext': 'suhosin.so',
  2579. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  2580. 'suhosin7_ext': 'suhosin7.so',
  2581. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  2582. 'svn': 'php5-svn',
  2583. 'sybase': 'php5-sybase',
  2584. 'tcpdf': 'php-tcpdf',
  2585. 'temp_dir': '/tmp',
  2586. 'tidy': 'php5-tidy',
  2587. 'uuid': 'php-uuid',
  2588. 'xcache': 'php5-xcache',
  2589. 'xdebug': 'php5-xdebug',
  2590. 'xml': 'php5',
  2591. 'xsl': 'php5-xsl',
  2592. 'zip': 'php5',
  2593. },
  2594. 'fpm': {
  2595. 'conf': '/etc/php5/fpm/php-fpm.conf',
  2596. 'ini': '/etc/php5/fpm/php.ini',
  2597. 'pools': '/etc/php5/fpm/pool.d',
  2598. 'service': 'php5-fpm',
  2599. 'user': 'root',
  2600. 'group': 'root',
  2601. 'defaults': odict([
  2602. ('global', odict([
  2603. ('pid', '/var/run/php5-fpm.pid'),
  2604. ('error_log', '/var/log/php5-fpm.log'),
  2605. ])),
  2606. ('include', '/etc/php5/fpm/pool.d/*.conf'),
  2607. ]),
  2608. },
  2609. 'hhvm': {
  2610. 'conf': '/etc/hhvm/server.ini',
  2611. 'ini': '/etc/hhvm/php.ini',
  2612. 'service': 'hhvm',
  2613. 'defaults': {},
  2614. 'server': odict([
  2615. ('pid', '/var/run/hhvm/pid'),
  2616. ('hhvm.server.port', '9000'),
  2617. ('hhvm.server.type', 'fastcgi'),
  2618. ('hhvm.server.default_document', 'index.php'),
  2619. ('hhvm.log.use_log_file', 'true'),
  2620. ('hhvm.log.file', '/var/log/hhvm/error.log'),
  2621. ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'),
  2622. ]),
  2623. 'php': odict([
  2624. ('session.save_handler', 'files'),
  2625. ('session.save_path', '/var/lib/hhvm/sessions'),
  2626. ('session.gc_maxlifetime', '1440'),
  2627. ('hhvm.log.level', 'Warning'),
  2628. ('hhvm.log.always_log_unhandled_exceptions', 'true'),
  2629. ('hhvm.log.runtime_error_reporting_level', '8191'),
  2630. ('hhvm.mysql.typed_results', 'false'),
  2631. ]),
  2632. },
  2633. 'cli': {
  2634. 'ini': '/etc/php5/cli/php.ini',
  2635. },
  2636. 'apache2': {
  2637. 'ini': '/etc/php5/apache2/php.ini',
  2638. },
  2639. 'xcache': {
  2640. 'ini': '/etc/php5/mods-available/xcache.ini',
  2641. 'defaults': {},
  2642. },
  2643. },
  2644. 'Gentoo' : {
  2645. 'pkgs': {
  2646. 'apache2': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[apache2]'}],
  2647. 'apc': [{'name': 'dev-php/pecl-apcu_bc','version': '[php_targets_php' + useversion + ']'}],
  2648. 'apcu': [{'name': 'dev-php/pecl-apcu','version': '[php_targets_php' + useversion + ']'}],
  2649. 'bcmath': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[bcmath]'}],
  2650. 'cache-lite': 'dev-php/PEAR-Cache_Lite',
  2651. 'cgi': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[cgi]'}],
  2652. 'cli': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[cli]'}],
  2653. 'composer_bin': 'composer',
  2654. 'console-table': 'dev-php/PEAR-Console_Table',
  2655. 'curl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[curl]'}],
  2656. 'ext_conf_path': '/etc/php/fpm-php' + phpng_version + '/ext',
  2657. 'fpm': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[fpm]'}],
  2658. 'gd': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[gd]'}],
  2659. 'geoip': [{'name': 'dev-php/pecl-geoip','version': '[php_targets_php' + useversion + ']'}],
  2660. 'gettext': 'dev-php/PEAR-File_Gettext',
  2661. 'gmp': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[gmp]'}],
  2662. 'imagick': [{'name': 'dev-php/pecl-imagick','version': '[php_targets_php' + useversion + ']'}],
  2663. 'imap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[imap]'}],
  2664. 'intl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[intl]'}],
  2665. 'json': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[json]'}],
  2666. 'ldap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[ldap]'}],
  2667. 'local_bin': '/usr/local/bin',
  2668. 'auth-sasl': 'dev-php/PEAR-Auth_SASL',
  2669. 'mail': 'dev-php/PHPMailer',
  2670. 'memcache': [{'name': 'dev-php/pecl-memcache','version': '[php_targets_php' + useversion + ']'}],
  2671. 'memcached': [{'name': 'dev-php/pecl-memcached','version': '[php_targets_php' + useversion + ']'}],
  2672. 'mongo': [{'name': 'dev-php/pecl-mongo','version': '[php_targets_php' + useversion + ']'}],
  2673. 'mongodb': [{'name': 'dev-php/pecl-mongodb','version': '[php_targets_php' + useversion + ']'}],
  2674. 'mysqlnd': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[mysql]'}],
  2675. 'mysql': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[mysqli]'}],
  2676. 'net-smtp': 'dev-php/PEAR-Net_SMTP',
  2677. 'net4': 'dev-php/PEAR-Net_IPv4',
  2678. 'net6': 'dev-php/PEAR-Net_IPv6',
  2679. 'oauth': [{'name': 'dev-php/pecl-oauth','version': '[php_targets_php' + useversion + ']'}],
  2680. 'opcache': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[opcache]'}],
  2681. 'pear': 'dev-php/pear',
  2682. 'pgsql': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[postgres]'}],
  2683. 'php': [{'name': 'dev-lang/php','version': ':' + phpng_version}],
  2684. 'pspell': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[spell]'}],
  2685. 'redis': [{'name': 'dev-php/pecl-redis','version': '[php_targets_php' + useversion + ']'}],
  2686. 'snmp': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[snmp]'}],
  2687. 'soap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[soap]'}],
  2688. 'ssh2': [{'name': 'dev-php/pecl-ssh2','version': '[php_targets_php' + useversion + ']'}],
  2689. 'sqlite': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[sqlite]'}],
  2690. 'sybase': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[sybase-ct]'}],
  2691. 'tcpdf': 'dev-php/tcpdf',
  2692. 'temp_dir': '/tmp',
  2693. 'tidy': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[tidy]'}],
  2694. 'xdebug': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[debug]'}],
  2695. 'xml': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[xml]'}],
  2696. 'xsl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[xslt]'}],
  2697. 'zip': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[zip]'}],
  2698. },
  2699. 'fpm': {
  2700. 'conf': '/etc/php/fpm-php' + phpng_version + '/php-fpm.conf',
  2701. 'ini': '/etc/php/fpm-php' + phpng_version + '/php.ini',
  2702. 'pools': '/etc/php/fpm-php' + phpng_version + '/fpm.d',
  2703. 'service': 'php-fpm',
  2704. 'user': 'root',
  2705. 'group': 'root',
  2706. 'defaults': odict([
  2707. ('global', odict([
  2708. ('pid', '/var/run/php-fpm-php' + phpng_version + '.pid'),
  2709. ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
  2710. ])),
  2711. ('include', '/etc/php/fpm-php' + phpng_version + '/fpm.d/*.conf'),
  2712. ]),
  2713. },
  2714. 'cli': {
  2715. 'ini': '/etc/php/cli-php' + phpng_version + '/php.ini',
  2716. },
  2717. 'apache2': {
  2718. 'ini': '/etc/php/apache2-php' + phpng_version + '/php.ini',
  2719. },
  2720. },
  2721. 'RedHat': {
  2722. 'pkgs': {
  2723. 'adodb': 'php-adodb',
  2724. 'apc': 'php-pecl-apc',
  2725. 'apcu': rh_prefix + 'php-pecl-apcu',
  2726. 'bcmath': rh_prefix + 'php-bcmath',
  2727. 'build_pkgs': ['openssl-devel', 'gcc'],
  2728. 'cache-lite': 'php-pear-Cache-Lite',
  2729. 'cgi': rh_prefix + 'php-cgi',
  2730. 'cli': rh_prefix + 'php-cli',
  2731. 'composer': 'composer',
  2732. 'composer_bin': 'composer',
  2733. 'console-table': 'php-pear-Console-Table',
  2734. 'curl': [rh_prefix + 'php-common', 'curl'],
  2735. 'dev': rh_prefix + 'php-devel',
  2736. 'ext_conf_path': '/etc/' + path_suffix + 'php.d',
  2737. 'fpm': rh_prefix + 'php-fpm',
  2738. 'gd': rh_prefix + 'php-gd',
  2739. 'geoip': sclo_prefix + 'php-pecl-geoip',
  2740. 'geshi': 'php-geshi',
  2741. 'gettext': 'php-php-gettext',
  2742. 'http': sclo_prefix + 'php-pecl-http',
  2743. 'imagick': sclo_prefix + 'php-pecl-imagick',
  2744. 'imap': sclo_prefix + 'php-imap',
  2745. 'intl': rh_prefix + 'php-intl',
  2746. 'json': rh_prefix + 'php-common',
  2747. 'ldap': rh_prefix + 'php-ldap',
  2748. 'local_bin': '/usr/local/bin',
  2749. 'auth-sasl': 'php-pear-Auth-SASL',
  2750. 'mail': 'php-pear-Mail',
  2751. 'mbstring': rh_prefix + 'php-mbstring',
  2752. 'mcrypt': sclo_prefix + 'php-mcrypt',
  2753. 'memcache': 'php-pecl-memcache',
  2754. 'memcached': sclo_prefix + 'php-pecl-memcached',
  2755. 'mysql': 'php-mysql',
  2756. 'mysqlnd': rh_prefix + 'php-mysqlnd',
  2757. 'net-smtp': 'php-pear-Net-SMTP',
  2758. 'net4': 'php-pear-Net-IPv4',
  2759. 'oauth': 'php-pecl-oauth',
  2760. 'opcache': rh_prefix + 'php-opcache' if salt['pillar.get']('php:use_scl_repo', False) else 'php-pecl-zendopcache',
  2761. 'pear': rh_prefix + 'php-pear',
  2762. 'pgsql': rh_prefix + 'php-pgsql',
  2763. 'php': rh_prefix + 'php',
  2764. 'pspell': rh_prefix + 'php-pspell',
  2765. 'redis': sclo_prefix + 'php-pecl-redis',
  2766. 'seclib': 'php-phpseclib',
  2767. 'snmp': rh_prefix + 'php-snmp',
  2768. 'soap': rh_prefix + 'php-soap',
  2769. 'sqlite': rh_prefix + 'php-pdo',
  2770. 'ssh2': sclo_prefix + 'php-pecl-ssh2',
  2771. 'suhosin5_ext': 'suhosin.so',
  2772. 'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
  2773. 'suhosin7_ext': 'suhosin7.so',
  2774. 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
  2775. 'tcpdf': 'php-tcpdf',
  2776. 'temp_dir': '/tmp',
  2777. 'tidy': sclo_prefix + 'php-tidy',
  2778. 'uuid': sclo_prefix + 'php-pecl-uuid',
  2779. 'xcache': 'php-xcache',
  2780. 'xdebug': sclo_prefix + 'php-pecl-xdebug',
  2781. 'xml': rh_prefix + 'php-xml',
  2782. 'xsl': rh_prefix + 'php-xml',
  2783. 'zip': rh_prefix + 'php',
  2784. },
  2785. 'fpm': {
  2786. 'conf': '/etc/' + path_suffix + 'php-fpm.conf',
  2787. 'ini': '/etc/' + path_suffix + 'php.ini',
  2788. 'pools': '/etc/' + path_suffix + 'php-fpm.d',
  2789. 'service': rh_prefix + 'php-fpm',
  2790. 'user': 'root',
  2791. 'group': 'root',
  2792. 'defaults': {
  2793. 'global': {
  2794. 'pid': '/var/' + path_suffix + 'run/php-fpm/php-fpm.pid',
  2795. 'error_log': '/var/' + path_suffix + 'log/php-fpm/error.log',
  2796. },
  2797. 'include': '/etc/' + path_suffix + 'php-fpm.d/*.conf',
  2798. },
  2799. },
  2800. 'cli': {
  2801. 'ini': '/etc/' + path_suffix + 'php.ini',
  2802. },
  2803. 'xcache': {
  2804. 'ini': '/etc/' + path_suffix + 'php.d/xcache.ini',
  2805. },
  2806. },
  2807. 'Suse': {
  2808. 'pkgs': {
  2809. 'adodb': 'php5-dba',
  2810. 'apache2': 'apache2-mod_php5',
  2811. 'cli': 'php5',
  2812. 'curl': 'php5-curl',
  2813. 'fpm': 'php5-fpm',
  2814. 'gd': 'php5-gd',
  2815. 'imap': 'php5-imap',
  2816. 'intl': 'php5-intl',
  2817. 'json': 'php5-json',
  2818. 'ldap': 'php5-ldap',
  2819. 'mbstring': 'php5-mbstring',
  2820. 'mcrypt': 'php5-mcrypt',
  2821. 'mysql': 'php5-mysql',
  2822. 'oauth': 'php5-oauth',
  2823. 'pear': 'php5-pear',
  2824. 'pgsql': 'php5-pgsql',
  2825. 'php': 'php5',
  2826. 'snmp': 'php5-snmp',
  2827. 'soap': 'php5-soap',
  2828. 'sqlite': 'php5-sqlite',
  2829. 'suhosin': 'php5-suhosin',
  2830. 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'],
  2831. 'zip': 'php5-zip',
  2832. },
  2833. 'fpm': {
  2834. 'conf': '/etc/php-fpm.conf',
  2835. 'ini': '/etc/php.ini',
  2836. 'pools': '/etc/php-fpm.d',
  2837. 'service': 'php-fpm',
  2838. 'user': 'root',
  2839. 'group': 'root',
  2840. 'defaults': {
  2841. 'global': {
  2842. 'pid': '/var/run/php-fpm/php-fpm.pid',
  2843. 'error_log': '/var/log/php-fpm/error.log',
  2844. },
  2845. 'include': '/etc/php-fpm.d/*.conf',
  2846. },
  2847. },
  2848. 'cli': {
  2849. 'ini': '/etc/php.ini',
  2850. },
  2851. },
  2852. 'Arch': {
  2853. 'pkgs': {
  2854. 'apc': 'php-apcu',
  2855. 'apcu': 'php-apcu-bc',
  2856. 'cgi': 'php-cgi',
  2857. 'cli': 'php',
  2858. 'composer_bin': 'composer',
  2859. 'curl': 'curl',
  2860. 'fpm': 'php-fpm',
  2861. 'gd': 'php-gd',
  2862. 'geoip': 'php-geoip',
  2863. 'imap': 'php-imap',
  2864. 'intl': 'php-intl',
  2865. 'local_bin': '/usr/local/bin',
  2866. 'mcrypt': 'php-mcrypt',
  2867. 'memcache': 'php-memcache',
  2868. 'memcached': 'php-memcached',
  2869. 'pgsql': 'php-pgsql',
  2870. 'php': 'php',
  2871. 'pspell': 'php-pspell',
  2872. 'snmp': 'php-snmp',
  2873. 'sqlite': 'php-sqlite',
  2874. 'temp_dir': '/tmp',
  2875. 'tidy': 'php-tidy',
  2876. 'xcache': 'php-xcache',
  2877. 'xdebug': 'xdebug',
  2878. 'xsl': 'php-xsl',
  2879. },
  2880. 'fpm': {
  2881. 'conf': '/etc/php/php-fpm.conf',
  2882. 'ini': '/etc/php/php.ini',
  2883. 'pools': '/etc/php/fpm.d',
  2884. 'service': 'php-fpm',
  2885. 'user': 'root',
  2886. 'group': 'root',
  2887. 'defaults': {
  2888. 'global': {
  2889. 'pid': '/run/php-fpm/php-fpm.pid',
  2890. 'error_log': 'log/php-fpm.log',
  2891. },
  2892. 'include': '/etc/php/fpm.d/*.conf',
  2893. },
  2894. },
  2895. 'cli': {
  2896. 'ini': '/etc/php/php-cli.ini',
  2897. },
  2898. 'xcache': {
  2899. 'ini': '/etc/php/conf.d/xcache.ini',
  2900. },
  2901. },
  2902. 'FreeBSD': {
  2903. 'apache2': {
  2904. 'ini': '/usr/local/etc/php.ini',
  2905. 'module_config': '/usr/local/etc/apache24/modules.d/050_mod_php.conf',
  2906. 'name': 'apache24',
  2907. },
  2908. 'cli': {
  2909. 'ini': '/usr/local/etc/php.ini'
  2910. },
  2911. 'pkgs': {
  2912. 'apache2': 'mod_php' + freebsd_phpng_version,
  2913. 'composer_bin': 'composer',
  2914. 'cli': 'php' + freebsd_phpng_version,
  2915. 'ctype': 'php' + freebsd_phpng_version + '-ctype',
  2916. 'curl': 'php' + freebsd_phpng_version + '-curl',
  2917. 'filter': 'php' + freebsd_phpng_version + '-filter',
  2918. 'fileinfo': 'php' + freebsd_phpng_version + '-fileinfo',
  2919. 'fpm': 'php' + freebsd_phpng_version,
  2920. 'gd': 'php' + freebsd_phpng_version + '-gd',
  2921. 'hash': 'php' + freebsd_phpng_version + '-hash',
  2922. 'json': 'php' + freebsd_phpng_version + '-json',
  2923. 'local_bin': '/usr/local/bin',
  2924. 'mbstring': 'php' + freebsd_phpng_version + '-mbstring',
  2925. 'mcrypt': 'php' + freebsd_phpng_version + '-mcrypt',
  2926. 'mysql': 'php' + freebsd_phpng_version + '-mysqli',
  2927. 'openssl': 'php' + freebsd_phpng_version + '-openssl',
  2928. 'php': 'php' + freebsd_phpng_version,
  2929. 'phar': 'php' + freebsd_phpng_version + '-phar',
  2930. 'posix': 'php' + freebsd_phpng_version + '-posix',
  2931. 'session': 'php' + freebsd_phpng_version + '-session',
  2932. 'snmp': 'php' + freebsd_phpng_version + '-snmp',
  2933. 'temp_dir': '/tmp',
  2934. 'tokenizer': 'php' + freebsd_phpng_version + '-tokenizer',
  2935. 'xml': 'php' + freebsd_phpng_version + '-xml',
  2936. 'zip': 'php' + freebsd_phpng_version + '-zip',
  2937. },
  2938. 'fpm': {
  2939. 'conf': '/usr/local/etc/php-fpm.conf',
  2940. 'ini': '/usr/local/etc/php.ini',
  2941. 'pools': '/usr/local/etc/php-fpm.d',
  2942. 'service': 'php-fpm',
  2943. 'user': 'root',
  2944. 'group': 'wheel',
  2945. 'defaults': {
  2946. 'global': {
  2947. 'pid': 'run/php-fpm.pid',
  2948. 'error_log': 'log/php-fpm.log',
  2949. },
  2950. 'include': '/usr/local/etc/php-fpm.d/*.conf',
  2951. },
  2952. },
  2953. },
  2954. }),
  2955. 'fpm': {
  2956. 'service': {
  2957. 'enabled': True,
  2958. 'opts': {},
  2959. },
  2960. 'config': {
  2961. 'ini': {
  2962. 'opts': {},
  2963. 'settings': {},
  2964. },
  2965. 'conf': {
  2966. 'opts': {},
  2967. 'settings': {},
  2968. },
  2969. },
  2970. 'pools': {
  2971. 'default.conf': {
  2972. 'enabled': False,
  2973. 'opts': {},
  2974. },
  2975. },
  2976. },
  2977. 'hhvm': {
  2978. 'service': {
  2979. 'enabled': True,
  2980. 'opts': {},
  2981. },
  2982. 'config': {
  2983. 'server': {
  2984. 'opts': {},
  2985. 'settings': {},
  2986. },
  2987. 'php': {
  2988. 'opts': {},
  2989. 'settings': {},
  2990. },
  2991. },
  2992. },
  2993. 'cli': {
  2994. 'ini': {
  2995. 'opts': {},
  2996. 'settings': {},
  2997. }
  2998. },
  2999. 'apache2': {
  3000. 'ini': {
  3001. 'opts': {},
  3002. 'settings': {},
  3003. }
  3004. },
  3005. 'xcache': {
  3006. 'ini': {
  3007. 'defaults': {
  3008. 'xcache-common': {
  3009. 'extension': 'xcache.so',
  3010. },
  3011. 'xcache.admin': {
  3012. 'xcache.admin.enable_auth': 'On',
  3013. },
  3014. 'xcache': {
  3015. 'xcache.shm_scheme': '"mmap"',
  3016. 'xcache.size': '60M',
  3017. 'xcache.count': '1',
  3018. 'xcache.slots': '8K',
  3019. 'xcache.ttl': '0',
  3020. 'xcache.gc_interval': '0',
  3021. 'xcache.var_size': '4M',
  3022. 'xcache.var_count': '1',
  3023. 'xcache.var_slots': '8K',
  3024. 'xcache.var_ttl': '0',
  3025. 'xcache.var_maxttl': '0',
  3026. 'xcache.var_gc_interval': '300',
  3027. 'xcache.var_namespace_mode': '0',
  3028. 'xcache.var_namespace': '""',
  3029. 'xcache.readonly_protection': 'Off',
  3030. 'xcache.mmap_path': '"/dev/zero"',
  3031. 'xcache.coredump_directory': '""',
  3032. 'xcache.coredump_type': '0',
  3033. 'xcache.disable_on_crash': 'Off',
  3034. 'xcache.experimental': 'Off',
  3035. 'xcache.cacher': 'On',
  3036. 'xcache.stat': 'On',
  3037. 'xcache.optimizer': 'Off',
  3038. },
  3039. 'xcache.coverager': {
  3040. 'xcache.coverager': 'Off',
  3041. 'xcache.coverager_autostart': 'On',
  3042. 'xcache.coveragedump_directory': '""',
  3043. },
  3044. },
  3045. 'opts': {},
  3046. 'settings': {},
  3047. }
  3048. },
  3049. 'ini': {
  3050. 'defaults': {
  3051. 'PHP': {
  3052. 'engine': 'On',
  3053. 'allow_url_fopen': 'On',
  3054. 'allow_url_include': 'Off',
  3055. 'asp_tags': 'Off',
  3056. 'auto_globals_jit': 'On',
  3057. 'default_mimetype': '"text/html"',
  3058. 'default_socket_timeout': 60,
  3059. 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled',
  3060. 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror',
  3061. 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'],
  3062. 'display_errors': 'Off',
  3063. 'display_startup_errors': 'Off',
  3064. 'enable_dl': 'Off',
  3065. 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'],
  3066. 'expose_php': 'On',
  3067. 'file_uploads': 'On',
  3068. 'html_errors': 'On',
  3069. 'ignore_repeated_errors': 'Off',
  3070. 'ignore_repeated_source': 'Off',
  3071. 'implicit_flush': 'Off',
  3072. 'log_errors': 'On',
  3073. 'log_errors_max_len': 1024,
  3074. 'max_execution_time': 30,
  3075. 'max_file_uploads': 20,
  3076. 'max_input_nesting_level': 64,
  3077. 'max_input_time': 60,
  3078. 'max_input_vars': 1000,
  3079. 'memory_limit': '128M',
  3080. 'output_buffering': 4096,
  3081. 'post_max_size': '8M',
  3082. 'precision': 14,
  3083. 'register_argc_argv': 'Off',
  3084. 'report_memleaks': 'On',
  3085. 'request_order': 'GP',
  3086. 'serialize_precision': 17,
  3087. 'short_open_tag': 'Off',
  3088. 'track_errors': 'Off',
  3089. 'upload_max_filesize': '2M',
  3090. 'variables_order': 'GPCS',
  3091. 'zend.enable_gc': 'On',
  3092. 'zlib.output_compression': 'Off',
  3093. },
  3094. 'CLI Server': {
  3095. 'cli_server.color': 'On'
  3096. },
  3097. 'Date': {
  3098. 'date.timezone': 'America/New_York'
  3099. },
  3100. 'Pdo_mysql': {
  3101. 'pdo_mysql.cache_size': 2000
  3102. },
  3103. 'mail function': {
  3104. 'SMTP': 'localhost',
  3105. 'mail.add_x_header': 'On'
  3106. },
  3107. 'SQL': {
  3108. 'sql.safe_mode': 'Off'
  3109. },
  3110. 'ODBC': {
  3111. 'odbc.allow_persistent': 'On',
  3112. 'odbc.check_persistent': 'On',
  3113. 'odbc.max_persistent': '-1',
  3114. 'odbc.max_links': '-1',
  3115. 'odbc.defaultlrl': 4096,
  3116. 'odbc.defaultbinmode': 1
  3117. },
  3118. 'Interbase': {
  3119. 'ibase.allow_persistent': 1,
  3120. 'ibase.max_persistent': -1,
  3121. 'ibase.max_links': -1,
  3122. 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"',
  3123. 'ibase.dateformat': '"%Y-%m-%d"',
  3124. 'ibase.timeformat': '"%H:%M:%S"'
  3125. },
  3126. 'MySQL': {
  3127. 'mysql.allow_local_infile': 'On',
  3128. 'mysql.allow_persistent': 'On',
  3129. 'mysql.cache_size': '2000',
  3130. 'mysql.max_persistent': -1,
  3131. 'mysql.max_links': -1,
  3132. 'mysql.connect_timeout': 60,
  3133. 'mysql.trace_mode': 'Off'
  3134. },
  3135. 'MySQLi': {
  3136. 'mysqli.max_persistent': -1,
  3137. 'mysqli.allow_persistent': 'On',
  3138. 'mysqli.max_links': -1,
  3139. 'mysqli.cache_size': 2000,
  3140. 'mysqli.default_port': 3306,
  3141. 'mysqli.reconnect': 'Off'
  3142. },
  3143. 'mysqlnd': {
  3144. 'mysqlnd.collect_statistics': 'On',
  3145. 'mysqlnd.collect_memory_statistics': 'Off'
  3146. },
  3147. 'PostgreSQL': {
  3148. 'pgsql.allow_persistent': 'On',
  3149. 'pgsql.auto_reset_persistent': 'Off',
  3150. 'pgsql.max_persistent': -1,
  3151. 'pgsql.max_links': -1,
  3152. 'pgsql.ignore_notice': 0,
  3153. 'pgsql.log_notice': 0
  3154. },
  3155. 'Sybase-CT': {
  3156. 'sybct.allow_persistent': 'On',
  3157. 'sybct.max_persistent': -1,
  3158. 'sybct.max_links': -1,
  3159. 'sybct.min_server_severity': 10,
  3160. 'sybct.min_client_severity': 10
  3161. },
  3162. 'bcmath': {
  3163. 'bcmath.scale': 0
  3164. },
  3165. 'Session': {
  3166. 'session.save_handler': 'files',
  3167. 'session.use_strict_mode': 0,
  3168. 'session.use_cookies': 1,
  3169. 'session.use_only_cookies': 1,
  3170. 'session.name': 'PHPSESSID',
  3171. 'session.auto_start': 0,
  3172. 'session.cookie_lifetime': 0,
  3173. 'session.cookie_path': '/',
  3174. 'session.serialize_handler': 'php',
  3175. 'session.gc_probability': 0,
  3176. 'session.gc_divisor': 1000,
  3177. 'session.gc_maxlifetime': 1440,
  3178. 'session.bug_compat_42': 'Off',
  3179. 'session.bug_compat_warn': 'Off',
  3180. 'session.cache_limiter': 'nocache',
  3181. 'session.cache_expire': '180',
  3182. 'session.use_trans_sid': 0,
  3183. 'session.hash_function': 0,
  3184. 'session.hash_bits_per_character': 5,
  3185. 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"'
  3186. },
  3187. 'MSSQL': {
  3188. 'mssql.allow_persistent': 'On',
  3189. 'mssql.max_persistent': -1,
  3190. 'mssql.max_links': -1,
  3191. 'mssql.min_error_severity': 10,
  3192. 'mssql.min_message_severity': 10,
  3193. 'mssql.compatibility_mode': 'Off',
  3194. 'mssql.secure_connection': 'Off'
  3195. },
  3196. 'Tidy': {
  3197. 'tidy.clean_output': 'Off'
  3198. },
  3199. 'soap': {
  3200. 'soap.wsdl_cache_enabled': 1,
  3201. 'soap.wsdl_cache_dir': '"/tmp"',
  3202. 'soap.wsdl_cache_ttl': 86400,
  3203. 'soap.wsdl_cache_limit': 5
  3204. },
  3205. 'ldap': {
  3206. 'ldap.max_links': -1
  3207. },
  3208. },
  3209. },
  3210. }, merge=True) %}
  3211. {%- endif %}