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.

3241 lines
158KB

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