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.

3246 line
158KB

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