summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/theme.maintenance.inc2
-rw-r--r--modules/system/system.install20
2 files changed, 19 insertions, 3 deletions
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 753b4a9d5..19b7fc742 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -127,7 +127,7 @@ function theme_install_page($content) {
// Special handling of warning messages
if (isset($messages['warning'])) {
- $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed.') : st('The following installation warning should be carefully reviewed.');
+ $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');
$variables['messages'] .= '<h4>'. $title .':</h4>';
$variables['messages'] .= theme('status_messages', 'warning');
}
diff --git a/modules/system/system.install b/modules/system/system.install
index 8035c8dbe..f27453442 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -68,19 +68,35 @@ function system_requirements($phase) {
'title' => $t('PHP memory limit'),
'value' => ini_get('memory_limit') ? ini_get('memory_limit') : '',
);
+
+ // get_cfg_var('cfg_file_path') returns the location of PHP's configuration file (php.ini)
+ // or FALSE if no configuration file is being used or an error occurred.
+ if (get_cfg_var('cfg_file_path')) {
+ $configuration_file_hint = t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => get_cfg_var('cfg_file_path')));
+ }
+ else {
+ $configuration_file_hint = t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
+ }
+
if ($phase == 'install') {
if (ini_get('memory_limit') && parse_size(ini_get('memory_limit')) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
- $requirements['php_memory_limit']['description'] = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process. If you have access to php.ini you can usually change this setting there. See the <a href="@url">Drupal requirements</a> for more information.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/requirements'));
+ $requirements['php_memory_limit']['description'] = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT));
$requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
}
}
elseif ($phase == 'runtime') {
if (ini_get('memory_limit') && parse_size(ini_get('memory_limit')) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
- $requirements['php_memory_limit']['description'] = $t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules. If you have access to php.ini you can usually change this setting there. See the <a href="@url">Drupal requirements</a> for more information.', array('%memory_limit' => ini_get('memory_limit'), '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/requirements'));
+ $requirements['php_memory_limit']['description'] = $t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => ini_get('memory_limit'), '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT));
$requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
}
}
+ // Add a hint to the warning regarding the location (if any) of the php.ini file.
+ if (isset($requirements['php_memory_limit']['description'])) {
+ $requirements['php_memory_limit']['description'] .= ' '. $configuration_file_hint;
+ $requirements['php_memory_limit']['description'] .= ' '. t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
+ }
+
// Test DB version
global $db_type;
if (function_exists('db_status_report')) {