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.

3213 satır
156KB

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