78 $statusArray = array();
102 $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsPhar();
103 $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsVfs();
110 foreach ($this->requiredPhpExtensions as $extension) {
131 $includePath = ini_get(
'include_path');
133 $pathArray = $this->
trimExplode($delimiter, $includePath);
134 if (!in_array(
'.', $pathArray)) {
136 $status->setTitle(
'Current directory (./) is not within PHP include path');
138 'include_path = ' . implode(
' ', $pathArray) . LF .
139 'Normally the current path \'.\' is included in the' .
140 ' include_path of PHP. Although TYPO3 does not rely on this,' .
141 ' it is an unusual setting that may introduce problems for' .
146 $status->setTitle(
'Current directory (./) is within PHP include path.');
157 if (!ini_get(
'file_uploads')) {
159 $status->setTitle(
'File uploads not allowed in PHP');
161 'file_uploads=' . ini_get(
'file_uploads') . LF .
162 'TYPO3 uses the ability to upload files from the browser in various cases.' .
163 ' If this flag is disabled in PHP, you won\'t be able to upload files.' .
164 ' But it doesn\'t end here, because not only are files not accepted by' .
165 ' the server - ALL content in the forms are discarded and therefore' .
166 ' nothing at all will be editable if you don\'t set this flag!' .
167 ' However if you cannot enable fileupload for some reason in PHP, alternatively' .
168 ' change the default form encoding value with \\$TYPO3_CONF_VARS[SYS][form_enctype].' 172 $status->setTitle(
'File uploads allowed in PHP');
184 $configuredMaximumUploadFilesize = 1024 * (int)
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'maxFileSize'];
185 if ($maximumUploadFilesize < $configuredMaximumUploadFilesize) {
187 $status->setTitle(
'PHP Maximum upload filesize too small');
189 'PHP upload_max_filesize = ' . (
int)($maximumUploadFilesize / 1024) .
' KB' . LF .
190 'TYPO3_CONF_VARS[BE][maxFileSize] = ' . (
int)($configuredMaximumUploadFilesize / 1024) .
' KB' . LF . LF .
191 'Currently PHP determines the limits for uploaded file\'s sizes and not TYPO3.' .
192 ' It is recommended that the value of upload_max_filesize is at least equal to the value' .
193 ' of TYPO3_CONF_VARS[BE][maxFileSize].' 197 $status->setTitle(
'PHP Maximum file upload size is higher than or equal to [BE][maxFileSize]');
210 if ($maximumPostSize > 0 && $maximumPostSize < $maximumUploadFilesize) {
212 $status->setTitle(
'Maximum size for POST requests is smaller than maximum upload filesize in PHP');
214 'upload_max_filesize=' . ini_get(
'upload_max_filesize') . LF .
215 'post_max_size=' . ini_get(
'post_max_size') . LF .
216 'You have defined a maximum size for file uploads in PHP which' .
217 ' exceeds the allowed size for POST requests. Therefore the' .
218 ' file uploads can also not be larger than ' . ini_get(
'post_max_size') .
'.' 222 $status->setTitle(
'Maximum post upload size correlates with maximum upload file size in PHP');
233 $minimumMemoryLimit = 32;
234 $recommendedMemoryLimit = 64;
236 if ($memoryLimit <= 0) {
238 $status->setTitle(
'Unlimited memory limit for PHP');
240 'PHP is configured not to limit memory usage at all. This is a risk' .
241 ' and should be avoided in production setup. In general it\'s best practice to limit this.' .
242 ' To be safe, set a limit in PHP, but with a minimum of ' . $recommendedMemoryLimit .
'MB:' . LF .
243 'memory_limit=' . $recommendedMemoryLimit .
'M' 245 } elseif ($memoryLimit < 1024 * 1024 * $minimumMemoryLimit) {
247 $status->setTitle(
'PHP Memory limit below ' . $minimumMemoryLimit .
'MB');
249 'memory_limit=' . ini_get(
'memory_limit') . LF .
250 'Your system is configured to enforce a memory limit for PHP scripts lower than ' .
251 $minimumMemoryLimit .
'MB. It is required to raise the limit.' .
252 ' We recommend a minimum PHP memory limit of ' . $recommendedMemoryLimit .
'MB:' . LF .
253 'memory_limit=' . $recommendedMemoryLimit .
'M' 255 } elseif ($memoryLimit < 1024 * 1024 * $recommendedMemoryLimit) {
257 $status->setTitle(
'PHP Memory limit below ' . $recommendedMemoryLimit .
'MB');
259 'memory_limit=' . ini_get(
'memory_limit') . LF .
260 'Your system is configured to enforce a memory limit for PHP scripts lower than ' .
261 $recommendedMemoryLimit .
'MB.' .
262 ' A slim TYPO3 instance without many extensions will probably work, but you should monitor your' .
263 ' system for "allowed memory size of X bytes exhausted" messages, especially if using the backend.' .
264 ' To be on the safe side,' .
' we recommend a minimum PHP memory limit of ' .
265 $recommendedMemoryLimit .
'MB:' . LF .
266 'memory_limit=' . $recommendedMemoryLimit .
'M' 270 $status->setTitle(
'PHP Memory limit is equal to or more than ' . $recommendedMemoryLimit .
'MB');
281 $minimumPhpVersion =
'5.3.7';
282 $currentPhpVersion = phpversion();
283 if (version_compare($currentPhpVersion, $minimumPhpVersion) < 0) {
285 $status->setTitle(
'PHP version too low');
287 'Your PHP version ' . $currentPhpVersion .
' is too old. TYPO3 CMS does not run' .
288 ' with this version. Update to at least PHP ' . $minimumPhpVersion
292 $status->setTitle(
'PHP version is fine');
303 $minimumMaximumExecutionTime = 30;
304 $recommendedMaximumExecutionTime = 240;
305 $currentMaximumExecutionTime = ini_get(
'max_execution_time');
306 if ($currentMaximumExecutionTime == 0) {
307 if (PHP_SAPI ===
'cli') {
309 $status->setTitle(
'Infinite PHP script execution time');
311 'Maximum PHP script execution time is always set to infinite (0) in cli mode.' .
312 ' The setting used for web requests cannot be checked from command line.' 316 $status->setTitle(
'Infinite PHP script execution time');
318 'max_execution_time=' . $currentMaximumExecutionTime . LF .
319 'While TYPO3 is fine with this, you risk a denial-of-service for your system if for whatever' .
320 ' reason some script hangs in an infinite loop. You are usually on the safe side ' .
321 ' if it is reduced to ' . $recommendedMaximumExecutionTime .
' seconds:' . LF .
322 'max_execution_time=' . $recommendedMaximumExecutionTime
325 } elseif ($currentMaximumExecutionTime < $minimumMaximumExecutionTime) {
327 $status->setTitle(
'Low PHP script execution time');
329 'max_execution_time=' . $currentMaximumExecutionTime . LF .
330 'Your max_execution_time is too low. Some expensive operations in TYPO3 can take longer than that.' .
331 ' It is recommended to raise the limit to ' . $recommendedMaximumExecutionTime .
' seconds:' . LF .
332 'max_execution_time=' . $recommendedMaximumExecutionTime
334 } elseif ($currentMaximumExecutionTime < $recommendedMaximumExecutionTime) {
336 $status->setTitle(
'Low PHP script execution time');
338 'max_execution_time=' . $currentMaximumExecutionTime . LF .
339 'Your max_execution_time is low. While TYPO3 often runs without problems' .
340 ' with ' . $minimumMaximumExecutionTime .
' seconds,' .
341 ' it may still happen that script execution is stopped before finishing' .
342 ' calculations. You should monitor the system for messages in this area' .
343 ' and maybe raise the limit to ' . $recommendedMaximumExecutionTime .
' seconds:' . LF .
344 'max_execution_time=' . $recommendedMaximumExecutionTime
348 $status->setTitle(
'Maximum PHP script execution time is equal to or more than ' 349 . $recommendedMaximumExecutionTime);
360 $disabledFunctions = trim(ini_get(
'disable_functions'));
363 $disabledFunctionsArray = $this->
trimExplode(
',', $disabledFunctions);
366 $findStrings = array(
370 foreach ($disabledFunctionsArray as $key => $disabledFunction) {
371 foreach ($findStrings as $findString) {
372 if (strpos($disabledFunction, $findString) !== FALSE) {
373 unset($disabledFunctionsArray[$key]);
378 if (strlen($disabledFunctions) > 0 && count($disabledFunctionsArray) > 0) {
380 $status->setTitle(
'Some PHP functions disabled');
382 'disable_functions=' . implode(
' ', explode(
',', $disabledFunctions)) . LF .
383 'These function(s) are disabled. TYPO3 uses some of those, so there might be trouble.' .
384 ' TYPO3 is designed to use the default set of PHP functions plus some common extensions.' .
385 ' Possibly these functions are disabled' .
386 ' due to security considerations and most likely the list would include a function like' .
387 ' exec() which is used by TYPO3 at various places. Depending on which exact functions' .
388 ' are disabled, some parts of the system may just break without further notice.' 390 } elseif (strlen($disabledFunctions) > 0 && count($disabledFunctionsArray) === 0) {
392 $status->setTitle(
'Some PHP functions currently disabled but OK');
394 'disable_functions=' . implode(
' ', explode(
',', $disabledFunctions)) . LF .
395 'These function(s) are disabled. TYPO3 uses currently none of those, so you are good to go.' 399 $status->setTitle(
'No disabled PHP functions');
411 $allowUrlFopen = (bool)ini_get(
'allow_url_fopen');
412 $curlEnabled = !empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'curlUse']);
413 if ($allowUrlFopen || $curlEnabled) {
415 $status->setTitle(
'Fetching external URLs is allowed');
418 $status->setTitle(
'Fetching external URLs is not allowed');
420 'Either enable PHP runtime setting "allow_url_fopen"' . LF .
'or enable curl by setting [SYS][curlUse] accordingly.' 433 $currentMysqliReconnectSetting = ini_get(
'mysqli.reconnect');
434 if ($currentMysqliReconnectSetting ===
'1') {
436 $status->setTitle(
'PHP mysqli.reconnect is enabled');
438 'mysqli.reconnect=1' . LF .
439 'PHP is configured to automatically reconnect the database connection on disconnection.' . LF .
440 ' Warning: If (e.g. during a long-running task) the connection is dropped and automatically reconnected, ' .
441 ' it may not be reinitialized properly (e.g. charset) and write mangled data to the database!' 445 $status->setTitle(
'PHP mysqli.reconnect is fine');
456 $safeModeEnabled = FALSE;
457 if (version_compare(phpversion(),
'5.4',
'<')) {
458 $safeModeEnabled = filter_var(
459 ini_get(
'safe_mode'),
460 FILTER_VALIDATE_BOOLEAN,
461 array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE)
464 if ($safeModeEnabled) {
466 $status->setTitle(
'PHP safe mode on');
468 'PHP safe_mode enabled. This is unsupported by TYPO3 CMS, it must be turned off:' . LF .
473 $status->setTitle(
'PHP safe mode off');
484 $docRootSetting = trim(ini_get(
'doc_root'));
485 if (strlen($docRootSetting) > 0) {
487 $status->setTitle(
'doc_root is set');
489 'doc_root=' . $docRootSetting . LF .
490 'PHP cannot execute scripts' .
491 ' outside this directory. This setting is seldom used and must correlate' .
492 ' with your actual document root. You might be in trouble if your' .
493 ' TYPO3 CMS core code is linked to some different location.' .
494 ' If that is a problem, the setting must be changed.' 498 $status->setTitle(
'PHP doc_root is not set');
509 $openBaseDirSetting = trim(ini_get(
'open_basedir'));
510 if (strlen($openBaseDirSetting) > 0) {
512 $status->setTitle(
'PHP open_basedir is set');
514 'open_basedir = ' . ini_get(
'open_basedir') . LF .
515 'This restricts TYPO3 to open and include files only in this' .
516 ' path. Please make sure that this does not prevent TYPO3 from running,' .
517 ' if for example your TYPO3 CMS core is linked to a different directory' .
518 ' not included in this path.' 522 $status->setTitle(
'PHP open_basedir is off');
533 if (extension_loaded(
'xdebug')) {
534 $recommendedMaxNestingLevel = 400;
535 $errorThreshold = 250;
536 $currentMaxNestingLevel = ini_get(
'xdebug.max_nesting_level');
537 if ($currentMaxNestingLevel < $errorThreshold) {
539 $status->setTitle(
'PHP xdebug.max_nesting_level is critically low');
541 'xdebug.max_nesting_level=' . $currentMaxNestingLevel . LF .
542 'This setting controls the maximum number of nested function calls to protect against' .
543 ' infinite recursion. The current value is too low for TYPO3 CMS and must' .
544 ' be either raised or xdebug has to be unloaded. A value of ' . $recommendedMaxNestingLevel .
545 ' is recommended. Warning: Expect fatal PHP errors in central parts of the CMS' .
546 ' if the value is not raised significantly to:' . LF .
547 'xdebug.max_nesting_level=' . $recommendedMaxNestingLevel
549 } elseif ($currentMaxNestingLevel < $recommendedMaxNestingLevel) {
551 $status->setTitle(
'PHP xdebug.max_nesting_level is low');
553 'xdebug.max_nesting_level=' . $currentMaxNestingLevel . LF .
554 'This setting controls the maximum number of nested function calls to protect against' .
555 ' infinite recursion. The current value is high enough for the TYPO3 CMS core to work' .
556 ' fine, but still some extensions could raise fatal PHP errors if the setting is not' .
557 ' raised further. A value of ' . $recommendedMaxNestingLevel .
' is recommended.' . LF .
558 'xdebug.max_nesting_level=' . $recommendedMaxNestingLevel
562 $status->setTitle(
'PHP xdebug.max_nesting_level ok');
566 $status->setTitle(
'PHP xdebug extension not loaded');
577 if (extension_loaded(
'openssl')) {
578 $testKey = @openssl_pkey_new();
579 if (is_resource($testKey)) {
580 openssl_free_key($testKey);
582 $status->setTitle(
'PHP OpenSSL extension installed properly');
585 $status->setTitle(
'PHP OpenSSL extension not working');
587 'Something went wrong while trying to create a new private key for testing.' .
588 ' Please check the integration of the PHP OpenSSL extension and if it is installed correctly.' 593 $status->setTitle(
'PHP OpenSSL extension not loaded');
595 'OpenSSL is a PHP extension to encrypt/decrypt data between requests.' .
596 ' TYPO3 CMS requires it to be able to encrypt stored passwords to improve the security in the' .
614 $status->setTitle(
'PHP suhosin extension loaded and active');
617 throw new \BadMethodCallException(
'Should be called only if suhosin extension is loaded', 1422634778);
627 $recommendedRequestMaxVars = 400;
629 $currentRequestMaxVars = ini_get(
'suhosin.request.max_vars');
630 if ($currentRequestMaxVars < $recommendedRequestMaxVars) {
632 $status->setTitle(
'PHP suhosin.request.max_vars too low');
634 'suhosin.request.max_vars=' . $currentRequestMaxVars . LF .
635 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
636 ' (as the install tool does). It is highly recommended to raise this' .
637 ' to at least ' . $recommendedRequestMaxVars .
':' . LF .
638 'suhosin.request.max_vars=' . $recommendedRequestMaxVars
642 $status->setTitle(
'PHP suhosin.request.max_vars ok');
646 $status->setTitle(
'Suhosin not loaded');
648 'If enabling suhosin, suhosin.request.max_vars' .
649 ' should be set to at least ' . $recommendedRequestMaxVars .
':' . LF .
650 'suhosin.request.max_vars=' . $recommendedRequestMaxVars
662 $recommendedRequestMaxVarnameLength = 200;
664 $currentRequestMaxVarnameLength = ini_get(
'suhosin.request.max_varname_length');
665 if ($currentRequestMaxVarnameLength < $recommendedRequestMaxVarnameLength) {
667 $status->setTitle(
'PHP suhosin.request.max_varname_length too low');
669 'suhosin.request.max_varname_length=' . $currentRequestMaxVarnameLength . LF .
670 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
671 ' (as the install tool does). It is highly recommended to raise this' .
672 ' to at least ' . $recommendedRequestMaxVarnameLength .
':' . LF .
673 'suhosin.request.max_varname_length=' . $recommendedRequestMaxVarnameLength
677 $status->setTitle(
'PHP suhosin.request.max_varname_length ok');
681 $status->setTitle(
'Suhosin not loaded');
683 'If enabling suhosin, suhosin.request.max_varname_length' .
684 ' should be set to at least ' . $recommendedRequestMaxVarnameLength .
':' . LF .
685 'suhosin.request.max_varname_length=' . $recommendedRequestMaxVarnameLength
697 $recommendedPostMaxNameLength = 200;
699 $currentPostMaxNameLength = ini_get(
'suhosin.post.max_name_length');
700 if ($currentPostMaxNameLength < $recommendedPostMaxNameLength) {
702 $status->setTitle(
'PHP suhosin.post.max_name_length too low');
704 'suhosin.post.max_name_length=' . $currentPostMaxNameLength . LF .
705 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
706 ' (as the install tool does). It is highly recommended to raise this' .
707 ' to at least ' . $recommendedPostMaxNameLength .
':' . LF .
708 'suhosin.post.max_name_length=' . $recommendedPostMaxNameLength
712 $status->setTitle(
'PHP suhosin.post.max_name_length ok');
716 $status->setTitle(
'Suhosin not loaded');
718 'If enabling suhosin, suhosin.post.max_name_length' .
719 ' should be set to at least ' . $recommendedPostMaxNameLength .
':' . LF .
720 'suhosin.post.max_name_length=' . $recommendedPostMaxNameLength
732 $recommendedPostMaxVars = 400;
734 $currentPostMaxVars = ini_get(
'suhosin.post.max_vars');
735 if ($currentPostMaxVars < $recommendedPostMaxVars) {
737 $status->setTitle(
'PHP suhosin.post.max_vars too low');
739 'suhosin.post.max_vars=' . $currentPostMaxVars . LF .
740 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
741 ' (as the install tool does). It is highly recommended to raise this' .
742 ' to at least ' . $recommendedPostMaxVars .
':' . LF .
743 'suhosin.post.max_vars=' . $recommendedPostMaxVars
747 $status->setTitle(
'PHP suhosin.post.max_vars ok');
751 $status->setTitle(
'Suhosin not loaded');
753 'If enabling suhosin, suhosin.post.max_vars' .
754 ' should be set to at least ' . $recommendedPostMaxVars .
':' . LF .
755 'suhosin.post.max_vars=' . $recommendedPostMaxVars
767 $recommendedGetMaxValueLength = 2000;
769 $currentGetMaxValueLength = ini_get(
'suhosin.get.max_value_length');
770 if ($currentGetMaxValueLength < $recommendedGetMaxValueLength) {
772 $status->setTitle(
'PHP suhosin.get.max_value_length too low');
774 'suhosin.get.max_value_length=' . $currentGetMaxValueLength . LF .
775 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
776 ' (as the install tool does). It is highly recommended to raise this' .
777 ' to at least ' . $recommendedGetMaxValueLength .
':' . LF .
778 'suhosin.get.max_value_length=' . $recommendedGetMaxValueLength
782 $status->setTitle(
'PHP suhosin.get.max_value_length ok');
786 $status->setTitle(
'Suhosin not loaded');
788 'If enabling suhosin, suhosin.get.max_value_length' .
789 ' should be set to at least ' . $recommendedGetMaxValueLength .
':' . LF .
790 'suhosin.get.max_value_length=' . $recommendedGetMaxValueLength
802 $recommendedGetMaxNameLength = 200;
804 $currentGetMaxNameLength = ini_get(
'suhosin.get.max_name_length');
805 if ($currentGetMaxNameLength < $recommendedGetMaxNameLength) {
807 $status->setTitle(
'PHP suhosin.get.max_name_length too low');
809 'suhosin.get.max_name_length=' . $currentGetMaxNameLength . LF .
810 'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
811 ' (as the install tool does). It is highly recommended to raise this' .
812 ' to at least ' . $recommendedGetMaxNameLength .
':' . LF .
813 'suhosin.get.max_name_length=' . $recommendedGetMaxNameLength
817 $status->setTitle(
'PHP suhosin.get.max_name_length ok');
821 $status->setTitle(
'Suhosin not loaded');
823 'If enabling suhosin, suhosin.get.max_name_length' .
824 ' should be set to at least ' . $recommendedGetMaxNameLength .
':' . LF .
825 'suhosin.get.max_name_length=' . $recommendedGetMaxNameLength
838 $whitelist = (string)ini_get(
'suhosin.executor.include.whitelist');
839 if (strpos($whitelist,
'phar') === FALSE) {
841 $status->setTitle(
'PHP suhosin.executor.include.whitelist does not contain phar');
843 'suhosin.executor.include.whitelist= ' . $whitelist . LF .
844 '"phar" is currently not a hard requirement of TYPO3 CMS but is nice to have and a possible' .
845 ' requirement in future versions. A useful setting is:' . LF .
846 'suhosin.executor.include.whitelist=phar,vfs' 850 $status->setTitle(
'PHP suhosin.executor.include.whitelist contains phar');
854 $status->setTitle(
'Suhosin not loaded');
856 'If enabling suhosin, a useful setting is:' . LF .
857 'suhosin.executor.include.whitelist=phar,vfs' 870 $whitelist = (string)ini_get(
'suhosin.executor.include.whitelist');
871 if (strpos($whitelist,
'vfs') === FALSE) {
873 $status->setTitle(
'PHP suhosin.executor.include.whitelist does not contain vfs');
875 'suhosin.executor.include.whitelist= ' . $whitelist . LF .
876 '"vfs" is currently not a hard requirement of TYPO3 CMS but tons of unit tests rely on it.' .
877 ' Furthermore, vfs will likely be a base for an additional compatibility layer in the future.' .
878 ' A useful setting is:' . LF .
879 'suhosin.executor.include.whitelist=phar,vfs' 883 $status->setTitle(
'PHP suhosin.executor.include.whitelist contains vfs');
887 $status->setTitle(
'Suhosin not loaded');
889 'If enabling suhosin, a useful setting is:' . LF .
890 'suhosin.executor.include.whitelist=phar,vfs' 903 $wikiLink =
'For more information take a look in our wiki ' . TYPO3_URL_WIKI_OPCODECACHE .
'.';
905 if (count($opcodeCaches) === 0) {
908 $status->setTitle(
'No PHP opcode cache loaded');
910 'PHP opcode caches hold a compiled version of executed PHP scripts in' .
911 ' memory and do not require to recompile a script each time it is accessed.' .
912 ' This can be a massive performance improvement and can reduce the load on a' .
913 ' server in general. A parse time reduction by factor three for fully cached' .
914 ' pages can be achieved easily if using an opcode cache.' .
921 foreach ($opcodeCaches as $opcodeCache => $properties) {
922 $message .=
'Name: ' . $opcodeCache .
' Version: ' . $properties[
'version'];
925 if ($properties[
'error']) {
927 if ($status->getSeverity() !==
'error') {
930 $message .=
' This opcode cache is marked as malfunctioning by the TYPO3 CMS Team.';
931 } elseif ($properties[
'canInvalidate']) {
932 $message .=
' This opcode cache should work correctly and has good performance.';
935 if ($status->getSeverity() !==
'error' || $status->getSeverity() !==
'warning') {
938 $message .=
' This opcode cache may work correctly but has medium performance.';
943 $message .= $wikiLink;
946 switch ($status->getSeverity()) {
948 $status->setTitle(
'A possibly malfunctioning PHP opcode cache is loaded');
951 $status->setTitle(
'A PHP opcode cache is loaded which may cause problems');
955 $status->setTitle(
'A PHP opcode cache is loaded');
958 $status->setMessage($message);
969 $testReflection = new \ReflectionMethod(get_class($this), __FUNCTION__);
970 if ($testReflection->getDocComment() === FALSE) {
972 $status->setTitle(
'PHP Doc comment reflection broken');
974 'TYPO3 CMS core extensions like extbase and fluid heavily rely on method' 975 .
' comment parsing to fetch annotations and add magic belonging to them.' 976 .
' This does not work in the current environment and so we cannot install' 978 .
' Here are some possibilities: ' . LF
979 .
'* In Zend OPcache you can disable saving/loading comments. If you are using' 980 .
' Zend OPcache (included since PHP 5.5) then check your php.ini settings for' 981 .
' opcache.save_comments and opcache.load_comments and enable them.' . LF
982 .
'* In Zend Optimizer+ you can disable saving comments. If you are using' 983 .
' Zend Optimizer+ then check your php.ini settings for' 984 .
' zend_optimizerplus.save_comments and enable it.' . LF
985 .
'* The PHP extension eaccelerator is known to break this if' 986 .
' it is compiled without --with-eaccelerator-doc-comment-inclusion flag.' 987 .
' This compile flag must be specified, otherwise TYPO3 CMS will not work.' . LF
988 .
'For more information take a look in our wiki ' . TYPO3_URL_WIKI_OPCODECACHE .
'.' 992 $status->setTitle(
'PHP Doc comment reflection works');
1004 $currentLocale = setlocale(LC_CTYPE, 0);
1007 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale'] ===
'' && TYPO3_OS !==
'WIN') {
1009 $status->setTitle(
'Empty systemLocale setting');
1010 $status->setMessage(
1011 '$GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is not set. This is fine as long as no UTF-8' .
1012 ' file system is used.' 1014 } elseif (setlocale(LC_CTYPE,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale']) === FALSE) {
1016 $status->setTitle(
'Incorrect systemLocale setting');
1017 $status->setMessage(
1018 'Current value of the $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is incorrect. A locale with' .
1019 ' this name doesn\'t exist in the operating system.' 1021 setlocale(LC_CTYPE, $currentLocale);
1024 $status->setTitle(
'System locale is correct');
1038 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'UTF8filesystem']) {
1041 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale'] ===
'' && TYPO3_OS !==
'WIN') {
1043 $status->setTitle(
'System locale not set on UTF-8 file system');
1044 $status->setMessage(
1045 '$GLOBALS[TYPO3_CONF_VARS][SYS][UTF8filesystem] is set, but $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale]' .
1046 ' is empty. Make sure a valid locale which supports UTF-8 is set.' 1049 $testString =
'ÖöĄĆŻĘĆćążąęó.jpg';
1050 $currentLocale = setlocale(LC_CTYPE, 0);
1051 $quote = TYPO3_OS ===
'WIN' ?
'"' :
'\'';
1053 setlocale(LC_CTYPE,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale']);
1055 if (escapeshellarg($testString) === $quote . $testString . $quote) {
1057 $status->setTitle(
'File names with UTF-8 characters can be used.');
1060 $status->setTitle(
'System locale setting doesn\'t support UTF-8 file names.');
1061 $status->setMessage(
1062 'Please check your $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] setting.' 1066 setlocale(LC_CTYPE, $currentLocale);
1072 $status->setTitle(
'Skipping test, as UTF8filesystem is not enabled.');
1086 && substr($_SERVER[
'SERVER_SOFTWARE'], 0, 6) ===
'Apache' 1089 $status->setTitle(
'Windows apache thread stack size');
1090 $status->setMessage(
1091 'This current value cannot be checked by the system, so please ignore this warning if it' .
1092 ' is already taken care of: Fluid uses complex regular expressions which require a lot' .
1093 ' of stack space during the first processing.' .
1094 ' On Windows the default stack size for Apache is a lot smaller than on UNIX.' .
1095 ' You can increase the size to 8MB (default on UNIX) by adding the following configuration' .
1096 ' to httpd.conf and restarting Apache afterwards:' . LF .
1097 '<IfModule mpm_winnt_module>' . LF .
1098 'ThreadStackSize 8388608' . LF .
1103 $status->setTitle(
'Apache ThreadStackSize is not an issue on UNIX systems');
1115 if (!extension_loaded($extension)) {
1117 $status->setTitle(
'PHP extension ' . $extension .
' not loaded');
1118 $status->setMessage(
1119 'TYPO3 CMS uses PHP extension ' . $extension .
' but it is not loaded' .
1120 ' in your environment. Change your environment to provide this extension.' 1124 $status->setTitle(
'PHP extension ' . $extension .
' loaded');
1135 if (function_exists(
'imagecreatetruecolor')) {
1136 $imageResource = @imagecreatetruecolor(50, 100);
1137 if (is_resource($imageResource)) {
1138 imagedestroy($imageResource);
1140 $status->setTitle(
'PHP GD library true color works');
1143 $status->setTitle(
'PHP GD library true color support broken');
1144 $status->setMessage(
1145 'GD is loaded, but calling imagecreatetruecolor() fails.' .
1146 ' This must be fixed, TYPO3 CMS won\'t work well otherwise.' 1151 $status->setTitle(
'PHP GD library true color support missing');
1152 $status->setMessage(
1153 'Gdlib is essential for TYPO3 CMS to work properly.' 1166 function_exists(
'imagecreatefromgif')
1167 && function_exists(
'imagegif')
1168 && (imagetypes() & IMG_GIF)
1170 $imageResource = @imagecreatefromgif(__DIR__ .
'/../../Resources/Public/Images/TestInput/Test.gif');
1171 if (is_resource($imageResource)) {
1172 imagedestroy($imageResource);
1174 $status->setTitle(
'PHP GD library has gif support');
1177 $status->setTitle(
'PHP GD library gif support broken');
1178 $status->setMessage(
1179 'GD is loaded, but calling imagecreatefromgif() fails.' .
1180 ' This must be fixed, TYPO3 CMS won\'t work well otherwise.' 1185 $status->setTitle(
'PHP GD library gif support missing');
1186 $status->setMessage(
1187 'GD must be compiled with gif support. This is essential for' .
1188 ' TYPO3 CMS to work properly.' 1201 function_exists(
'imagecreatefromjpeg')
1202 && function_exists(
'imagejpeg')
1203 && (imagetypes() & IMG_JPG)
1206 $status->setTitle(
'PHP GD library has jpg support');
1209 $status->setTitle(
'PHP GD library jpg support missing');
1210 $status->setMessage(
1211 'GD must be compiled with jpg support. This is essential for' .
1212 ' TYPO3 CMS to work properly.' 1225 function_exists(
'imagecreatefrompng')
1226 && function_exists(
'imagepng')
1227 && (imagetypes() & IMG_PNG)
1229 $imageResource = @imagecreatefrompng(__DIR__ .
'/../../Resources/Public/Images/TestInput/Test.png');
1230 if (is_resource($imageResource)) {
1231 imagedestroy($imageResource);
1233 $status->setTitle(
'PHP GD library has png support');
1236 $status->setTitle(
'PHP GD library png support broken');
1237 $status->setMessage(
1238 'GD is compiled with png support, but calling imagecreatefrompng() fails.' .
1239 ' Check your environment and fix it, png in GD lib is important' .
1240 ' for TYPO3 CMS to work properly.' 1245 $status->setTitle(
'PHP GD library png support missing');
1246 $status->setMessage(
1247 'GD must be compiled with png support. This is essential for' .
1248 ' TYPO3 CMS to work properly' 1260 if (function_exists(
'imagettftext')) {
1262 $status->setTitle(
'PHP GD library has freetype font support');
1263 $status->setMessage(
1264 'There is a difference between the font size setting which the GD' .
1265 ' library should be supplied with. If installation is completed' .
1266 ' a test in the install tool helps to find out the value you need.' 1270 $status->setTitle(
'PHP GD library freetype support missing');
1271 $status->setMessage(
1272 'Some core functionality and extension rely on the GD' .
1273 ' to render fonts on images. This support is missing' .
1274 ' in your environment. Install it.' 1286 if (function_exists(
'imageftbbox')) {
1288 $fontSize = (20 / 96 * 72);
1289 $textDimensions = @imageftbbox(
1292 __DIR__ .
'/../../Resources/Private/Font/vera.ttf',
1293 'Testing true type support' 1295 $fontBoxWidth = $textDimensions[2] - $textDimensions[0];
1296 if ($fontBoxWidth < 300 && $fontBoxWidth > 200) {
1298 $status->setTitle(
'FreeType True Type Font DPI');
1299 $status->setMessage(
'Fonts are rendered by FreeType library. ' .
1300 'We need to ensure that the final dimensions are as expected. ' .
1301 'This server renderes fonts based on 96 DPI correctly' 1305 $status->setTitle(
'FreeType True Type Font DPI');
1306 $status->setMessage(
'Fonts are rendered by FreeType library. ' .
1307 'This server does not render fonts as expected. ' .
1308 'Please configure FreeType or TYPO3_CONF_VARS[GFX][TTFdpi]' 1313 $status->setTitle(
'PHP GD library freetype2 support missing');
1314 $status->setMessage(
1315 'The core relies on GD library compiled into PHP with freetype2' .
1316 ' support. This is missing on your system. Please install it.' 1329 $magicQuotesGpc = get_magic_quotes_gpc();
1330 if ($magicQuotesGpc) {
1332 $status->setTitle(
'PHP magic quotes on');
1333 $status->setMessage(
1334 'magic_quotes_gpc=' . $magicQuotesGpc . LF .
1335 'Setting magic_quotes_gpc is deprecated since PHP 5.3.' .
1336 ' You are advised to disable it until it is completely removed:' . LF .
1337 'magic_quotes_gpc=Off' 1341 $status->setTitle(
'PHP magic quotes off');
1352 $registerGlobalsEnabled = filter_var(
1353 ini_get(
'register_globals'),
1354 FILTER_VALIDATE_BOOLEAN,
1355 array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE)
1357 if ($registerGlobalsEnabled === TRUE) {
1359 $status->setTitle(
'PHP register globals on');
1360 $status->setMessage(
1361 'register_globals=' . ini_get(
'register_globals') . LF .
1362 'TYPO3 requires PHP setting "register_globals" set to off.' .
1363 ' This ancient PHP setting is a big security problem and should' .
1364 ' never be enabled:' . LF .
1365 'register_globals=Off' 1369 $status->setTitle(
'PHP register globals off');
1380 $sampleArray = array(
'Test>><<Data');
1382 $xmlContent =
'<numIndex index="0">Test>><<Data</numIndex>' . LF;
1386 if ($xmlContent !== $xml) {
1388 $status->setTitle(
'PHP libxml bug present');
1389 $status->setMessage(
1390 'Some hosts have problems saving ">><<" in a flexform.' .
1391 ' To fix this, enable [BE][flexformForceCDATA] in' .
1392 ' All Configuration.' 1396 $status->setTitle(
'PHP libxml bug not present');
1412 return filter_var($ip, FILTER_VALIDATE_IP) !== FALSE;
1422 if (!stristr(PHP_OS,
'darwin') && stristr(PHP_OS,
'win')) {
1434 $suhosinLoaded = FALSE;
1435 if (extension_loaded(
'suhosin')) {
1436 $suhosinInSimulationMode = filter_var(
1437 ini_get(
'suhosin.simulation'),
1438 FILTER_VALIDATE_BOOLEAN,
1439 array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE)
1441 if (!$suhosinInSimulationMode) {
1442 $suhosinLoaded = TRUE;
1445 return $suhosinLoaded;
1457 $explodedValues = explode($delimiter, $string);
1458 $resultWithPossibleEmptyValues = array_map(
'trim', $explodedValues);
1460 foreach ($resultWithPossibleEmptyValues as $value) {
1461 if ($value !==
'') {
1475 $bytes = doubleval($measurement);
1476 if (stripos($measurement,
'G')) {
1477 $bytes *= 1024 * 1024 * 1024;
1478 } elseif (stripos($measurement,
'M')) {
1479 $bytes *= 1024 * 1024;
1480 } elseif (stripos($measurement,
'K')) {
checkSuhosinExecutorIncludeWhiteListContainsVfs()
checkMaximumFileUploadSize()
checkMysqliReconnectSetting()
checkSomePhpOpcodeCacheIsLoaded()
checkSuhosinGetMaxValueLength()
getBytesFromSizeMeasurement($measurement)
checkSuhosinRequestMaxVars()
trimExplode($delimiter, $string)
checkCurrentDirectoryIsInIncludePath()
checkReflectionDocComment()
isSuhosinLoadedAndActive()
checkGdLibTrueColorSupport()
static array2xml(array $array, $NSprefix='', $level=0, $docTag='phparray', $spaceInd=0, array $options=array(), array $stackData=array())
checkSuhosinRequestMaxVarnameLength()
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
checkGdLibFreeTypeSupport()
checkSuhosinPostMaxVars()
checkXdebugMaxNestingLevel()
checkWindowsApacheThreadStackSize()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
isTrueTypeFontDpiStandard()
checkRequiredPhpExtension($extension)
checkSuhosinExecutorIncludeWhiteListContainsPhar()
checkLocaleWithUTF8filesystem()
checkSuhosinGetMaxNameLength()
checkPostUploadSizeIsHigherOrEqualMaximumFileUploadSize()
checkSuhosinPostMaxNameLength()