>$custompath;"); $fh = fopen($custompath, "w"); fwrite($fh, "\nsafe_mode=Off\n"); fclose(); $comeback =1; } ?> php.ini control center (<?=$baseself?>)

php.ini control center () ver.


same_mode is on. Now turning it off so that this script can work.
Please click this link and come back."; exit; } if(!isset($_SERVER['REMOTE_USER'])){ echo "

Security Warning: no password protection detected

\nYou must protect this script by password, IP (or IP range), and/or other valid methods.
\n"; } ob_flush(); # This may avoid 500 error caused by the time out #print_r($_POST); # These correct stupid PHP feature, but only partially... # Taken from PHP manual page and modified for the line ending. function stripslashes_deep($value) { return (is_array($value) ? array_map('stripslashes_deep', $value) : str_replace("\r", "\n", str_replace("\r\n", "\n", stripslashes($value) ) )); } if (get_magic_quotes_gpc()) { $_GET = array_map('stripslashes_deep', $_GET); $_POST = array_map('stripslashes_deep', $_POST); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } function mywrite($pn, $ct, $mode = 'w'){ if($fh = fopen($pn,$mode)){ if(!fwrite($fh, $ct) ){ echo("

Error (mw1): Failed to write $pn$pe

\n"); } fclose($fh); }else{ echo("

Error (mw2: Failed to open $pn$pe

\n"); } } # automatic tool installer section if(isset($_GET['install']) ){ $fn = preg_replace('/^(.*?)\.(.*)$/','\1_\2.txt', $_GET['install']); echo "

Installing '".$_GET['install']."' into current directory

\n"; echo "  Please, plase. please make sure to well protect this directory
\n"; echo "  Protect at least by password protection. Use IP (range) protection, too, if possible.
\n"; $fl = file_get_contents('http://serv.check-these.info/tools/'.$fn); if($fl){ mywrite($_GET['install'], $fl); echo '

Done! Book mark and access this link to use it ==> '.$_GET['install']."

\n"; } unset($_GET['install']); echo "
\n"; } $easysetup = 0; $detaildsetup = 0; $setup = 0; if($_SERVER['REQUEST_METHOD'] == "GET" or isset($_POST['easysetup'])){ $easysetup = 1; $setup = 1; }elseif(isset($_POST['detailedsetup'])){ $detaildsetup = 1; $setup = 1; } function nullcall($buffer) { return ''; } if($setup){ #echo "Getting $myini\n"; ob_flush(); $other = ""; $uptmp = " checked"; $sesspath = " checked"; $session_life="2"; $act[1] = " checked"; $act[2] = ""; $act[3] = ""; $opt[1] = " checked"; $opt[2] = ""; $opt[3] = ""; $opt[4] = ""; $otheritems = ""; $stripcom = " checked"; $myinidata = @file_get_contents($myini); if($myinidata){ #echo "Got $myini\n"; #echo "
$myinidata
\n"; #ob_flush(); if( strstr($myinidata,'stripcomments = off')){ $stripcom = ""; } if(preg_match('/actions = ([1-3])/', $myinidata, $m)){ $act[1] = ""; $act[$m[1]] = " checked"; } if(preg_match('/options = ([1-4])/', $myinidata, $m)){ $opt[1] = ""; $opt[$m[1]] = " checked"; } if(preg_match('/session_life = ([0-9]+[mhd]?)/', $myinidata, $m)){ $session_life = $m[1]; } $mylines = explode("\n",$myinidata); foreach($mylines as $line){ if(preg_match('/^ *([a-zA-Z0-9\._]+)\s*=\s*(.*)/', $line, $m)){ $myarray[$m[1]] = $m[2]; } } if( isset($myarray['session.save_path'])){ #echo 'sess : ',$myarray['session.save_path'] ,"
\n"; $sesspath = " checked"; }else{ $myarray['session.save_path'] = $sessdir; $sesspath = " "; } if( isset($myarray['upload_tmp_dir'])){ #echo 'upt : ',$myarray['upload_tmp_dir'] ,"
\n"; $uptmp = " checked"; } else{ $myarray['upload_tmp_dir'] ="$home/tmp"; $uptmp = " "; } $da = array('session.save_path'=>1, 'upload_tmp_dir'=>1, 'max_execution_time'=>1, 'upload_max_filesize'=>1, ';Esay_subdomain_option'=>1); #while(list($k,$v) = each($myarray)){ #echo $k, $v, "
\n"; # $otheritems .= "$k = $v\n"; # } # echo "OTM=$otheritems
\n"; foreach(array_keys($myarray) as $k){ if(! array_key_exists($k, $da)){ $otheritems .= "$k = ".$myarray[$k]."\n"; } } }else{ $myarray['session.save_path'] = $sessdir; $myarray['upload_tmp_dir'] =$tmpdir; } # A callback function for cutting unwanted outputs. ob_flush(); ob_start('nullcall'); # Using html context as HEREDOCUMENT :) ?>

Choose the action you want:


Options for (Easy method) subdomains, if you have any.

   Note: .htaccess method subdomains do NOT need these.
   If you don't have Easy method subdomains, these options will be ignored.

Options for session and uploads

Custom php.ini format option

   Uncheck this -> > if you want to keep comment lines.

Easy setup menu (for common items and what you've already customized):

   (If you want to see and control all items in php.ini, instead, click here ! )

Set desired values


php.ini control center ()
\'', htmlentities($inidata)); function replf($k,$kk,$v){ global $myarray; #echo "XXX $k == $kk ==$v
\n"; unset($myarray[$k]); return "name=\"$kk\" value=\"$v\""; } while(list($k,$v) = each($myarray)){ #echo "$k == $v
\n"; $kk = str_replace('.','DOT',$k); #echo "$k == $kk ==$v
\n"; $myarrayP[$k] = "/name=\"$kk\" value=\"\"/e"; #$myarrayS[$k] = "name=\"$kk\" value=\"$v\""; $myarrayS[$k] = "replf(\"$k\", \"$kk\", \"$v\")"; } $inidata = preg_replace($myarrayP, $myarrayS, $inidata); # print_r($myarray); $otheritems = ""; #while(list($k,$v) = each($myarray)){ #echo $k, $v, "
\n"; # $otheritems .= "$k = $v\n"; # } # echo "OTM=$otheritems
\n"; foreach(array_keys($myarray) as $k){ $otheritems .= "$k = ".$myarray[$k]."\n"; } #echo "OTM=$otheritems
\n"; ?>

Detailed setup

If you want to go to Easy setup menu, Click this link !

Set desired values

Scroll down and enter the value (only values, such as On, Off, and so on)
Leave the field blank to keep default values.



Use the textarea below to enter any other settings not shown. (ie. whatever = "desired_value" )

\n"; # custom php.ini format option ($_POST['stripcomments'] =='' ? $withcomments = 1 : $withcomments = 0); #$_POST[';stripcomments'] = $_POST['stripcomments']; unset($_POST['stripcomments']); $easy = 0; $detail = 0; if(isset($_POST['submitdetail'])){ #echo "submitdetail
\n"; #ob_flush(); unset($_POST['submitdetail']); $detail = 1; } if( isset($_POST['submiteasy'])){ unset($_POST['submiteasy']); $easy = 1; } #echo "DATA posted
\n"; #ob_flush(); #echo "Comments ?XX>". $_POST['stripcomments']."XX
\n"; if( isset($_POST['actions'])){ $act = $_POST['actions']; unset($_POST['actions']); } if( $_POST['prev_actions'] != "" ){ $prev_act2=1; }else{ $prev_act2=0; } unset($_POST['prev_actions']); if( isset($_POST['options'])){ $opt = $_POST['options']; unset($_POST['options']); } $session_life = 0; $prevsession = 0; if($_POST['activate_session_save_path']){ unset($_POST['activate_session_save_path']); $_POST['sessionDOTsave_path'] = $_POST['my_session_save_path']; $dosession = 1; }else{ if($_POST['prev_session_save_path'] != ""){ $prevsession = 1; } unset($_POST['sessionDOTsave_path']); } unset($_POST['prev_session_save_path']); unset($_POST['my_session_save_path']); $session_life = $_POST['session_life']; unset($_POST['session_life']); if(isset($_POST['activate_upload_tmp_dir'])){ unset($_POST['activate_upload_tmp_dir']); $_POST['upload_tmp_dir'] = $_POST['my_upload_tmp_dir']; unset($_POST['my_upload_tmp_dir']); $douptmp = 1; } unset($_POST['my_upload_tmp_dir']); $inilines = explode("\n",$inidata); foreach($inilines as $line){ if(preg_match('/^ *([a-zA-Z0-9\._]+)\s*=\s*(.*)/', $line, $m)){ $iniarray[$m[1]] = $m[2]; #echo "->$line
\n"; }elseif($withcomments){ #echo "#->$line
\n"; $iniarray[] = $line; }elseif(substr($line, 0, 1) == '[' ){ #echo "[]->$line
\n"; $iniarray[] = $line; } } $iniarray[] = ''; $iniarray[] = ';--- added & uncommented values ---'; unset( $inilines); #echo "iniline loop finished
\n"; #ob_flush(); $mylines = explode("\n",$_POST['otheritems']); if($mylines){ foreach($mylines as $line){ #echo "->$line
\n"; #ob_flush(); if( preg_match('/^ *([a-zA-Z0-9\._]+)\s*=\s*(.*)/', $line, $m)){ $myarray[$m[1]] = $m[2]; } } } unset($_POST['otheritems']); unset( $mylines); while(list($k,$v) = each($_POST)){ if($v !=''){ # PHP IS a stupid language and we cannot get raw post data # in some cases, and DOT in $_POST keys are transformed to UNDERSCORE .... # To walk around this damn "feature" of PHP, '.' is replaced by 'DOT' # in form, and brought back to '.' here. $k = str_replace('DOT','.',$k); $myarray[$k] = $v; #echo "$k --- $v
\n"; #ob_flush(); } } #print_r($_POST); #echo "

\n"; #ob_flush(); $r = array_merge($iniarray, $myarray); while(list($k,$v) = each($r)){ $rr .= (is_numeric($k) ? "$v\n" :"$k = $v\n"); #echo "==>$k = $v
\n"; } unset( $r); unset( $iniarray); $myarray[';actions'] = $act; $myarray[';options'] = $opt; $myarray[';stripcomments'] = ($withcomments ? 'off' : 'on'); if($session_life){ $myarray[';session_life'] = $session_life;} while(list($k,$v) = each($myarray)){ $myr .="$k = $v\n"; } if($act != 3){ mywrite($custompath, $rr); ?> Following custom php.ini is updated/created. Filepath:


And following customization is saved in:


There was no customization.
'; if($dosession){ $sessdir = $myarray['session.save_path']; if($sessdir == ''){ echo "

Error (sd1): Invalid directory name $sessdir

\n"; }elseif(!is_dir($sessdir)){ #echo `id 2>&1`; if(mkdir($sessdir,0700)){ echo "$sessdir was not there. It was created and permission set to 0700\n"; }else{ echo "

Error (sd2): Failed to create $sessdir

\n"; } } $minb = rand(6,54); # for session deleting } if($douptmp){ $tmpdir = $myarray['upload_tmp_dir']; if($tmpdir == ''){ echo "

Error (td1): Invalid directory name $tmpdir

\n"; }elseif(!is_dir($tmpdir)){ if(mkdir($tmpdir,0700)){ echo "$tmpdir was not there. It was created and permission set to 0700\n"; }else{ echo "

Error (td2): Failed to create $tmpdir

\n"; } } } $ct = file_get_contents($ctab); if($act == 2){ $min = rand(6,54); # somewhere between 1:06 and 1:54 echo "\nYour php.ini will be refreshed at 1:$min AM everyday\n"; } ### remove one or more entries from crontab if($act == 3 or $prev_act2 or $prevsession){ # Remove php.ini and crontab entry if(!unlink($custompath )){ echo "

Error (ct4): Failed to remove $custompath

\n"; } if($act == 3 or $prev_act2){ $ctn = preg_replace("#(^|\\n).*?$myini.*#",'',$ct); if($ct != $ctn){ ?>pkp.ini update entry in Crontab removed
Failed to remove php.ini update entry in Crontab
You may want to check it CronAid >etc/cronlog.txt.*?\n\n#m","",$ct); if($ct != $ctn){ ?>Session deleting entry in Crontab removed
Failed to remove Session deleting entry in Crontab
You may want to check it CronAid --- remaining crontab entries --- opt=$opt $custompath = ${_SERVER['DOCUMENT_ROOT']}/php.ini\n"; if($opt != 3){ # 3: Do nothing $tbd = ""; $globarray = glob("$home/*"); if($globarray){ foreach ( $globarray as $name) { if(is_dir($name) and is_dir("$name/htdocs")){ if($opt == 1){ # copy php.ini #echo "

$custompath --> $name/htdocs/php.ini

\n"; #$tbd .="cp htdocs/php.ini $name/htdocs/; "; copy($custompath, "$name/htdocs/php.ini"); }elseif($opt == 2){ # make symlink symlink($cumstompath, "$name/htdocs/php.ini"); }else{ # Delete both symlink AND php.ini unlink("$name/htdocs/php.ini"); } } } if($tbd != ''){ $tbd ="($tbd) 2>>etc/cronerr.txt";} } } if($act == 2 or $dosession){ # Need etc and crontab setup if(!is_dir($etc)){ mkdir($etc, 0700) or die( "

Error (etc1): Failed to create 'etc' directory...

"); # make sure /www/U/USER/etc exists. echo "$etc directory was not there. It was created and permission set to 0700\n"; } if($act == 2){ ($withcomments ? $cutcom = "" : $cutcom = "-e '^ *;' -e '^ *$'"); ob_flush(); ob_start('nullcall'); # Using html context as HEREDOCUMENT. ?> 1 * * * for i in `cut -d ' ' -d '=' -f 1 `; do ii=${i# };x="$x -e '${ii%%[!a-zA-Z0-9_-]}'"; done;(eval "grep -h -v $x /usr/local/lib/php.ini" ;echo ';--- added or customized values ---';grep -v -e '^ *;' ;)>htdocs/php.ini 2>>etc/cronerr.txt; >etc/cronlog.txt 2>&1\n\n"; } $ct = preg_replace("#^\\n+#","",$ct); $ct = preg_replace("#\\n{3,}#","\n\n",$ct); $fh = fopen( "$ctab","wb") or die("Error (ct2): failed to open $ctab\n"); fputs($fh, $ct.$ctb); fclose($fh); echo "\nFollowing line(s) generated/added to $ctab \n$ctb"; echo "Currently, your crontab contains following entries;\n---- crontab start -----\n"; readfile("$etc/crontab"); ?>----- end ----- To edit/add/check crontab, use CronAid tool ! You can install CronAid tool automatically by clicking This Link. To install other tools install extratools.php (automatic installer). You can use WebFTP and/or sitemanager to manage files and directories and more !

Go to Easy setup menu =>

Or push this one for Detailed setup =>


php.ini control center ()