* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/admin/system/phpinfo.php * \brief Page des infos systeme de php */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("admin"); $langs->load("install"); $langs->load("errors"); if (! $user->admin) accessforbidden(); /* * View */ llxHeader(); $title='InfoPHP'; if (isset($title)) { print load_fiche_titre($langs->trans($title), '', 'title_setup'); } // Check PHP setup is OK $maxphp=@ini_get('upload_max_filesize'); // In unknown if (preg_match('/k$/i', $maxphp)) $maxphp=$maxphp*1; if (preg_match('/m$/i', $maxphp)) $maxphp=$maxphp*1024; if (preg_match('/g$/i', $maxphp)) $maxphp=$maxphp*1024*1024; if (preg_match('/t$/i', $maxphp)) $maxphp=$maxphp*1024*1024*1024; $maxphp2=@ini_get('post_max_size'); // In unknown if (preg_match('/k$/i', $maxphp2)) $maxphp2=$maxphp2*1; if (preg_match('/m$/i', $maxphp2)) $maxphp2=$maxphp2*1024; if (preg_match('/g$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024; if (preg_match('/t$/i', $maxphp2)) $maxphp2=$maxphp2*1024*1024*1024; if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) { $langs->load("errors"); print info_admin($langs->trans("WarningParamUploadMaxFileSizeHigherThanPostMaxSize", @ini_get('upload_max_filesize'), @ini_get('post_max_size')), 0, 0, 0, 'warning'); print '
'; } print ''; print ''; print "\n"; $ErrorPicturePath = "../../theme/eldy/img/error.png"; $WarningPicturePath = "../../theme/eldy/img/warning.png"; $OkayPicturePath = "../../theme/eldy/img/tick.png"; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Version").''; $arrayphpminversionerror = array(5,5,0); $arrayphpminversionwarning = array(5,5,0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); } elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) { print 'Warning '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); } else { print 'Ok '.versiontostring(versionphparray()); } print '
GET and POST support'; if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]) && ! isset($_GET["mainmenu"])) { print 'Warning '.$langs->trans("PHPSupportPOSTGETKo"); print ' ('.$langs->trans("Recheck").')'; } else { print 'Ok '.$langs->trans("PHPSupportPOSTGETOk"); } print '
Sessions support'; if (! function_exists("session_id")) { print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions"); } else { print 'Ok '.$langs->trans("PHPSupportSessions"); } print '
GD support'; if (! function_exists("imagecreate")) { print 'Warning '.$langs->trans("ErrorPHPDoesNotSupportGD"); } else { print 'Ok '.$langs->trans("PHPSupportGD"); } print '
Curl support'; if (! function_exists("curl_init")) { print 'Warning '.$langs->trans("ErrorPHPDoesNotSupportCurl"); } else { print 'Ok '.$langs->trans("PHPSupportCurl"); } print '
UTF-8 support'; if (! function_exists("utf8_encode")) { print 'Warning '.$langs->trans("ErrorPHPDoesNotSupportUTF8"); } else { print 'Ok '.$langs->trans("PHPSupportUTF8"); } print '
Intl support'; if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { if (! function_exists("locale_get_primary_language") || ! function_exists("locale_get_region")) { print 'Warning '.$langs->trans("ErrorPHPDoesNotSupportIntl"); } else { print 'Ok '.$langs->trans("PHPSupportIntl"); } } print '
Zip support'; if (!class_exists('ZipArchive')) { print 'Warning '.$langs->trans("ErrorPHPDoesNotSupport", "Zip"); } else { print 'Ok '.$langs->trans("PHPSupport", "Zip"); } print '
'; print '
'; // Get php_info array $phparray=phpinfo_array(); foreach($phparray as $key => $value) { print '
'; print ''; print ''; //print ''; print ''; print ''; print "\n"; //var_dump($value); foreach($value as $keyparam => $keyvalue) { if (! is_array($keyvalue)) { print ''; print ''; $valtoshow=$keyvalue; if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue, 80); print ''; print ''; } else { print ''; print ''; $i=0; foreach($keyvalue as $keyparam2 => $keyvalue2) { print ''; } print ''; } } print '
'.$langs->trans("Parameter").''.$key.''.$langs->trans("Value").'
'.$keyparam.''; if ($keyparam == 'Path') $valtoshow=implode('; ', explode(';', trim($valtoshow))); if ($keyparam == 'PATH') $valtoshow=implode('; ', explode(';', trim($valtoshow))); if ($keyparam == '_SERVER["PATH"]') $valtoshow=implode('; ', explode(';', trim($valtoshow))); print $valtoshow; print '
'.$keyparam.''; $valtoshow=$keyvalue2; if ($keyparam == 'disable_functions') $valtoshow=implode(', ', explode(',', trim($valtoshow))); //print $keyparam; print $valtoshow; $i++; print '
'; print '
'; print '
'; } // End of page llxFooter(); $db->close();