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.

3211 lines
155KB

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