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.

3245 lines
158KB

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