DiagnoseCommand.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Command;
  12. use Composer\Composer;
  13. use Composer\Factory;
  14. use Composer\Config;
  15. use Composer\Downloader\TransportException;
  16. use Composer\Plugin\CommandEvent;
  17. use Composer\Plugin\PluginEvents;
  18. use Composer\Util\ConfigValidator;
  19. use Composer\Util\ProcessExecutor;
  20. use Composer\Util\RemoteFilesystem;
  21. use Composer\Util\StreamContextFactory;
  22. use Composer\Util\Keys;
  23. use Symfony\Component\Console\Input\InputInterface;
  24. use Symfony\Component\Console\Output\OutputInterface;
  25. /**
  26. * @author Jordi Boggiano <j.boggiano@seld.be>
  27. */
  28. class DiagnoseCommand extends BaseCommand
  29. {
  30. /** @var RemoteFileSystem */
  31. protected $rfs;
  32. /** @var ProcessExecutor */
  33. protected $process;
  34. /** @var int */
  35. protected $failures = 0;
  36. protected function configure()
  37. {
  38. $this
  39. ->setName('diagnose')
  40. ->setDescription('Diagnoses the system to identify common errors.')
  41. ->setHelp(<<<EOT
  42. The <info>diagnose</info> command checks common errors to help debugging problems.
  43. EOT
  44. )
  45. ;
  46. }
  47. /**
  48. * {@inheritdoc}
  49. */
  50. protected function execute(InputInterface $input, OutputInterface $output)
  51. {
  52. $composer = $this->getComposer(false);
  53. $io = $this->getIO();
  54. if ($composer) {
  55. $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'diagnose', $input, $output);
  56. $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
  57. $io->write('Checking composer.json: ', false);
  58. $this->outputResult($this->checkComposerSchema());
  59. }
  60. if ($composer) {
  61. $config = $composer->getConfig();
  62. } else {
  63. $config = Factory::createConfig();
  64. }
  65. $this->rfs = Factory::createRemoteFilesystem($io, $config);
  66. $this->process = new ProcessExecutor($io);
  67. $io->write('Checking platform settings: ', false);
  68. $this->outputResult($this->checkPlatform());
  69. $io->write('Checking git settings: ', false);
  70. $this->outputResult($this->checkGit());
  71. $io->write('Checking http connectivity to packagist: ', false);
  72. $this->outputResult($this->checkHttp('http', $config));
  73. $io->write('Checking https connectivity to packagist: ', false);
  74. $this->outputResult($this->checkHttp('https', $config));
  75. $opts = stream_context_get_options(StreamContextFactory::getContext('http://example.org'));
  76. if (!empty($opts['http']['proxy'])) {
  77. $io->write('Checking HTTP proxy: ', false);
  78. $this->outputResult($this->checkHttpProxy());
  79. $io->write('Checking HTTP proxy support for request_fulluri: ', false);
  80. $this->outputResult($this->checkHttpProxyFullUriRequestParam());
  81. $io->write('Checking HTTPS proxy support for request_fulluri: ', false);
  82. $this->outputResult($this->checkHttpsProxyFullUriRequestParam());
  83. }
  84. if ($oauth = $config->get('github-oauth')) {
  85. foreach ($oauth as $domain => $token) {
  86. $io->write('Checking '.$domain.' oauth access: ', false);
  87. $this->outputResult($this->checkGithubOauth($domain, $token));
  88. }
  89. } else {
  90. $io->write('Checking github.com rate limit: ', false);
  91. try {
  92. $rate = $this->getGithubRateLimit('github.com');
  93. $this->outputResult(true);
  94. if (10 > $rate['remaining']) {
  95. $io->write('<warning>WARNING</warning>');
  96. $io->write(sprintf(
  97. '<comment>Github has a rate limit on their API. '
  98. . 'You currently have <options=bold>%u</options=bold> '
  99. . 'out of <options=bold>%u</options=bold> requests left.' . PHP_EOL
  100. . 'See https://developer.github.com/v3/#rate-limiting and also' . PHP_EOL
  101. . ' https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens</comment>',
  102. $rate['remaining'],
  103. $rate['limit']
  104. ));
  105. }
  106. } catch (\Exception $e) {
  107. if ($e instanceof TransportException && $e->getCode() === 401) {
  108. $this->outputResult('<comment>The oauth token for github.com seems invalid, run "composer config --global --unset github-oauth.github.com" to remove it</comment>');
  109. } else {
  110. $this->outputResult($e);
  111. }
  112. }
  113. }
  114. $io->write('Checking disk free space: ', false);
  115. $this->outputResult($this->checkDiskSpace($config));
  116. if ('phar:' === substr(__FILE__, 0, 5)) {
  117. $io->write('Checking pubkeys: ', false);
  118. $this->outputResult($this->checkPubKeys($config));
  119. $io->write('Checking composer version: ', false);
  120. $this->outputResult($this->checkVersion());
  121. }
  122. return $this->failures;
  123. }
  124. private function checkComposerSchema()
  125. {
  126. $validator = new ConfigValidator($this->getIO());
  127. list($errors, , $warnings) = $validator->validate(Factory::getComposerFile());
  128. if ($errors || $warnings) {
  129. $messages = array(
  130. 'error' => $errors,
  131. 'warning' => $warnings,
  132. );
  133. $output = '';
  134. foreach ($messages as $style => $msgs) {
  135. foreach ($msgs as $msg) {
  136. $output .= '<' . $style . '>' . $msg . '</' . $style . '>' . PHP_EOL;
  137. }
  138. }
  139. return rtrim($output);
  140. }
  141. return true;
  142. }
  143. private function checkGit()
  144. {
  145. $this->process->execute('git config color.ui', $output);
  146. if (strtolower(trim($output)) === 'always') {
  147. return '<comment>Your git color.ui setting is set to always, this is known to create issues. Use "git config --global color.ui true" to set it correctly.</comment>';
  148. }
  149. return true;
  150. }
  151. private function checkHttp($proto, Config $config)
  152. {
  153. $disableTls = false;
  154. $result = array();
  155. if ($proto === 'https' && $config->get('disable-tls') === true) {
  156. $disableTls = true;
  157. $result[] = '<warning>Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>';
  158. }
  159. if ($proto === 'https' && !extension_loaded('openssl') && !$disableTls) {
  160. $result[] = '<error>Composer is configured to use SSL/TLS protection but the openssl extension is not available.</error>';
  161. }
  162. try {
  163. $this->rfs->getContents('packagist.org', $proto . '://packagist.org/packages.json', false);
  164. } catch (TransportException $e) {
  165. if (false !== strpos($e->getMessage(), 'cafile')) {
  166. $result[] = '<error>[' . get_class($e) . '] ' . $e->getMessage() . '</error>';
  167. $result[] = '<error>Unable to locate a valid CA certificate file. You must set a valid \'cafile\' option.</error>';
  168. $result[] = '<error>You can alternatively disable this error, at your own risk, by enabling the \'disable-tls\' option.</error>';
  169. } else {
  170. array_unshift($result, '[' . get_class($e) . '] ' . $e->getMessage());
  171. }
  172. }
  173. if (count($result) > 0) {
  174. return $result;
  175. }
  176. return true;
  177. }
  178. private function checkHttpProxy()
  179. {
  180. $protocol = extension_loaded('openssl') ? 'https' : 'http';
  181. try {
  182. $json = json_decode($this->rfs->getContents('packagist.org', $protocol . '://packagist.org/packages.json', false), true);
  183. $hash = reset($json['provider-includes']);
  184. $hash = $hash['sha256'];
  185. $path = str_replace('%hash%', $hash, key($json['provider-includes']));
  186. $provider = $this->rfs->getContents('packagist.org', $protocol . '://packagist.org/'.$path, false);
  187. if (hash('sha256', $provider) !== $hash) {
  188. return 'It seems that your proxy is modifying http traffic on the fly';
  189. }
  190. } catch (\Exception $e) {
  191. return $e;
  192. }
  193. return true;
  194. }
  195. /**
  196. * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
  197. * and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
  198. * This method will test, if you need to disable this parameter via setting extra environment variable in your system.
  199. *
  200. * @return bool|string
  201. */
  202. private function checkHttpProxyFullUriRequestParam()
  203. {
  204. $url = 'http://packagist.org/packages.json';
  205. try {
  206. $this->rfs->getContents('packagist.org', $url, false);
  207. } catch (TransportException $e) {
  208. try {
  209. $this->rfs->getContents('packagist.org', $url, false, array('http' => array('request_fulluri' => false)));
  210. } catch (TransportException $e) {
  211. return 'Unable to assess the situation, maybe packagist.org is down ('.$e->getMessage().')';
  212. }
  213. return 'It seems there is a problem with your proxy server, try setting the "HTTP_PROXY_REQUEST_FULLURI" and "HTTPS_PROXY_REQUEST_FULLURI" environment variables to "false"';
  214. }
  215. return true;
  216. }
  217. /**
  218. * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
  219. * and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
  220. * This method will test, if you need to disable this parameter via setting extra environment variable in your system.
  221. *
  222. * @return bool|string
  223. */
  224. private function checkHttpsProxyFullUriRequestParam()
  225. {
  226. if (!extension_loaded('openssl')) {
  227. return 'You need the openssl extension installed for this check';
  228. }
  229. $url = 'https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0';
  230. try {
  231. $this->rfs->getContents('github.com', $url, false);
  232. } catch (TransportException $e) {
  233. try {
  234. $this->rfs->getContents('github.com', $url, false, array('http' => array('request_fulluri' => false)));
  235. } catch (TransportException $e) {
  236. return 'Unable to assess the situation, maybe github is down ('.$e->getMessage().')';
  237. }
  238. return 'It seems there is a problem with your proxy server, try setting the "HTTPS_PROXY_REQUEST_FULLURI" environment variable to "false"';
  239. }
  240. return true;
  241. }
  242. private function checkGithubOauth($domain, $token)
  243. {
  244. $this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
  245. try {
  246. $url = $domain === 'github.com' ? 'https://api.'.$domain.'/' : 'https://'.$domain.'/api/v3/';
  247. return $this->rfs->getContents($domain, $url, false, array(
  248. 'retry-auth-failure' => false,
  249. )) ? true : 'Unexpected error';
  250. } catch (\Exception $e) {
  251. if ($e instanceof TransportException && $e->getCode() === 401) {
  252. return '<comment>The oauth token for '.$domain.' seems invalid, run "composer config --global --unset github-oauth.'.$domain.'" to remove it</comment>';
  253. }
  254. return $e;
  255. }
  256. }
  257. /**
  258. * @param string $domain
  259. * @param string $token
  260. * @throws TransportException
  261. * @return array
  262. */
  263. private function getGithubRateLimit($domain, $token = null)
  264. {
  265. if ($token) {
  266. $this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
  267. }
  268. $url = $domain === 'github.com' ? 'https://api.'.$domain.'/rate_limit' : 'https://'.$domain.'/api/rate_limit';
  269. $json = $this->rfs->getContents($domain, $url, false, array('retry-auth-failure' => false));
  270. $data = json_decode($json, true);
  271. return $data['resources']['core'];
  272. }
  273. private function checkDiskSpace($config)
  274. {
  275. $minSpaceFree = 1024 * 1024;
  276. if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
  277. || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
  278. ) {
  279. return '<error>The disk hosting '.$dir.' is full</error>';
  280. }
  281. return true;
  282. }
  283. private function checkPubKeys($config)
  284. {
  285. $home = $config->get('home');
  286. $errors = array();
  287. $io = $this->getIO();
  288. if (file_exists($home.'/keys.tags.pub') && file_exists($home.'/keys.dev.pub')) {
  289. $io->write('');
  290. }
  291. if (file_exists($home.'/keys.tags.pub')) {
  292. $io->write('Tags Public Key Fingerprint: ' . Keys::fingerprint($home.'/keys.tags.pub'));
  293. } else {
  294. $errors[] = '<error>Missing pubkey for tags verification</error>';
  295. }
  296. if (file_exists($home.'/keys.dev.pub')) {
  297. $io->write('Dev Public Key Fingerprint: ' . Keys::fingerprint($home.'/keys.dev.pub'));
  298. } else {
  299. $errors[] = '<error>Missing pubkey for dev verification</error>';
  300. }
  301. if ($errors) {
  302. $errors[] = '<error>Run composer self-update --update-keys to set them up</error>';
  303. }
  304. return $errors ?: true;
  305. }
  306. private function checkVersion()
  307. {
  308. $protocol = extension_loaded('openssl') ? 'https' : 'http';
  309. $latest = trim($this->rfs->getContents('getcomposer.org', $protocol . '://getcomposer.org/version', false));
  310. if (Composer::VERSION !== $latest && Composer::VERSION !== '@package_version@') {
  311. return '<comment>You are not running the latest version, run `composer self-update` to update</comment>';
  312. }
  313. return true;
  314. }
  315. /**
  316. * @param bool|string|\Exception $result
  317. */
  318. private function outputResult($result)
  319. {
  320. $io = $this->getIO();
  321. if (true === $result) {
  322. $io->write('<info>OK</info>');
  323. } else {
  324. $this->failures++;
  325. $io->write('<error>FAIL</error>');
  326. if ($result instanceof \Exception) {
  327. $io->write('['.get_class($result).'] '.$result->getMessage());
  328. } elseif ($result) {
  329. if (is_array($result)) {
  330. foreach ($result as $message) {
  331. $io->write($message);
  332. }
  333. } else {
  334. $io->write($result);
  335. }
  336. }
  337. }
  338. }
  339. private function checkPlatform()
  340. {
  341. $output = '';
  342. $out = function ($msg, $style) use (&$output) {
  343. $output .= '<'.$style.'>'.$msg.'</'.$style.'>'.PHP_EOL;
  344. };
  345. // code below taken from getcomposer.org/installer, any changes should be made there and replicated here
  346. $errors = array();
  347. $warnings = array();
  348. $iniPath = php_ini_loaded_file();
  349. $displayIniMessage = false;
  350. if ($iniPath) {
  351. $iniMessage = PHP_EOL.PHP_EOL.'The php.ini used by your command-line PHP is: ' . $iniPath;
  352. } else {
  353. $iniMessage = PHP_EOL.PHP_EOL.'A php.ini file does not exist. You will have to create one.';
  354. }
  355. $iniMessage .= PHP_EOL.'If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.';
  356. if (!function_exists('json_decode')) {
  357. $errors['json'] = true;
  358. }
  359. if (!extension_loaded('Phar')) {
  360. $errors['phar'] = true;
  361. }
  362. if (!extension_loaded('filter')) {
  363. $errors['filter'] = true;
  364. }
  365. if (!extension_loaded('hash')) {
  366. $errors['hash'] = true;
  367. }
  368. if (!extension_loaded('iconv') && !extension_loaded('mbstring')) {
  369. $errors['iconv_mbstring'] = true;
  370. }
  371. if (!ini_get('allow_url_fopen')) {
  372. $errors['allow_url_fopen'] = true;
  373. }
  374. if (extension_loaded('ionCube Loader') && ioncube_loader_iversion() < 40009) {
  375. $errors['ioncube'] = ioncube_loader_version();
  376. }
  377. if (PHP_VERSION_ID < 50302) {
  378. $errors['php'] = PHP_VERSION;
  379. }
  380. if (!isset($errors['php']) && PHP_VERSION_ID < 50304) {
  381. $warnings['php'] = PHP_VERSION;
  382. }
  383. if (!extension_loaded('openssl')) {
  384. $errors['openssl'] = true;
  385. }
  386. if (extension_loaded('openssl') && OPENSSL_VERSION_NUMBER < 0x1000100f) {
  387. $warnings['openssl_version'] = true;
  388. }
  389. if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
  390. $warnings['apc_cli'] = true;
  391. }
  392. ob_start();
  393. phpinfo(INFO_GENERAL);
  394. $phpinfo = ob_get_clean();
  395. if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {
  396. $configure = $match[1];
  397. if (false !== strpos($configure, '--enable-sigchild')) {
  398. $warnings['sigchild'] = true;
  399. }
  400. if (false !== strpos($configure, '--with-curlwrappers')) {
  401. $warnings['curlwrappers'] = true;
  402. }
  403. }
  404. if (ini_get('xdebug.profiler_enabled')) {
  405. $warnings['xdebug_profile'] = true;
  406. } elseif (extension_loaded('xdebug')) {
  407. $warnings['xdebug_loaded'] = true;
  408. }
  409. if (!empty($errors)) {
  410. foreach ($errors as $error => $current) {
  411. switch ($error) {
  412. case 'json':
  413. $text = PHP_EOL."The json extension is missing.".PHP_EOL;
  414. $text .= "Install it or recompile php without --disable-json";
  415. break;
  416. case 'phar':
  417. $text = PHP_EOL."The phar extension is missing.".PHP_EOL;
  418. $text .= "Install it or recompile php without --disable-phar";
  419. break;
  420. case 'filter':
  421. $text = PHP_EOL."The filter extension is missing.".PHP_EOL;
  422. $text .= "Install it or recompile php without --disable-filter";
  423. break;
  424. case 'hash':
  425. $text = PHP_EOL."The hash extension is missing.".PHP_EOL;
  426. $text .= "Install it or recompile php without --disable-hash";
  427. break;
  428. case 'iconv_mbstring':
  429. $text = PHP_EOL."The iconv OR mbstring extension is required and both are missing.".PHP_EOL;
  430. $text .= "Install either of them or recompile php without --disable-iconv";
  431. break;
  432. case 'unicode':
  433. $text = PHP_EOL."The detect_unicode setting must be disabled.".PHP_EOL;
  434. $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
  435. $text .= " detect_unicode = Off";
  436. $displayIniMessage = true;
  437. break;
  438. case 'suhosin':
  439. $text = PHP_EOL."The suhosin.executor.include.whitelist setting is incorrect.".PHP_EOL;
  440. $text .= "Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):".PHP_EOL;
  441. $text .= " suhosin.executor.include.whitelist = phar ".$current;
  442. $displayIniMessage = true;
  443. break;
  444. case 'php':
  445. $text = PHP_EOL."Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.2 or higher.";
  446. break;
  447. case 'allow_url_fopen':
  448. $text = PHP_EOL."The allow_url_fopen setting is incorrect.".PHP_EOL;
  449. $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
  450. $text .= " allow_url_fopen = On";
  451. $displayIniMessage = true;
  452. break;
  453. case 'ioncube':
  454. $text = PHP_EOL."Your ionCube Loader extension ($current) is incompatible with Phar files.".PHP_EOL;
  455. $text .= "Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your `php.ini` to disable it:".PHP_EOL;
  456. $text .= " zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so";
  457. $displayIniMessage = true;
  458. break;
  459. case 'openssl':
  460. $text = PHP_EOL."The openssl extension is missing, which means that secure HTTPS transfers are impossible.".PHP_EOL;
  461. $text .= "If possible you should enable it or recompile php with --with-openssl";
  462. break;
  463. }
  464. $out($text, 'error');
  465. }
  466. $output .= PHP_EOL;
  467. }
  468. if (!empty($warnings)) {
  469. foreach ($warnings as $warning => $current) {
  470. switch ($warning) {
  471. case 'apc_cli':
  472. $text = "The apc.enable_cli setting is incorrect.".PHP_EOL;
  473. $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
  474. $text .= " apc.enable_cli = Off";
  475. $displayIniMessage = true;
  476. break;
  477. case 'sigchild':
  478. $text = "PHP was compiled with --enable-sigchild which can cause issues on some platforms.".PHP_EOL;
  479. $text .= "Recompile it without this flag if possible, see also:".PHP_EOL;
  480. $text .= " https://bugs.php.net/bug.php?id=22999";
  481. break;
  482. case 'curlwrappers':
  483. $text = "PHP was compiled with --with-curlwrappers which will cause issues with HTTP authentication and GitHub.".PHP_EOL;
  484. $text .= " Recompile it without this flag if possible";
  485. break;
  486. case 'php':
  487. $text = "Your PHP ({$current}) is quite old, upgrading to PHP 5.3.4 or higher is recommended.".PHP_EOL;
  488. $text .= " Composer works with 5.3.2+ for most people, but there might be edge case issues.";
  489. break;
  490. case 'openssl_version':
  491. // Attempt to parse version number out, fallback to whole string value.
  492. $opensslVersion = strstr(trim(strstr(OPENSSL_VERSION_TEXT, ' ')), ' ', true);
  493. $opensslVersion = $opensslVersion ?: OPENSSL_VERSION_TEXT;
  494. $text = "The OpenSSL library ({$opensslVersion}) used by PHP does not support TLSv1.2 or TLSv1.1.".PHP_EOL;
  495. $text .= "If possible you should upgrade OpenSSL to version 1.0.1 or above.";
  496. break;
  497. case 'xdebug_loaded':
  498. $text = "The xdebug extension is loaded, this can slow down Composer a little.".PHP_EOL;
  499. $text .= " Disabling it when using Composer is recommended.";
  500. break;
  501. case 'xdebug_profile':
  502. $text = "The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.".PHP_EOL;
  503. $text .= "Add the following to the end of your `php.ini` to disable it:".PHP_EOL;
  504. $text .= " xdebug.profiler_enabled = 0";
  505. $displayIniMessage = true;
  506. break;
  507. }
  508. $out($text, 'comment');
  509. }
  510. }
  511. if ($displayIniMessage) {
  512. $out($iniMessage, 'comment');
  513. }
  514. return !$warnings && !$errors ? true : $output;
  515. }
  516. }