note 108414 added to phar.using.intro
| From: | paa dot listas at gmail dot com | Date: | Tue, 24 Apr 2012 19:19:26 +0000 |
| Subject: | note 108414 added to phar.using.intro | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187327@lists.php.net to get a copy of this message | ||
In the latest version of phpMyAdmin, this link, in the home page, does not work under PHAR:
"The phpMyAdmin configuration storage is not completely configured, some extended features have
been deactivated. To find out why click here."
Where
'here' == http://xxx.tld/chk_rel.php?token=8f42712b867a3060d34d3eaa418c3c
I used this code to build the:
----- CUT HERE (phpMyAdmin-2-phar.php) -----
<?php
/*
$ ls ./
phpMyAdmin-2-phar.php <-- This file.
phpMyAdmin-3.5.0-all-languages.tar.gz
*/
$APP_NAME='Milib';
$MYAPP='phpMyAdmin3.phar.tar.php';
$SRC_APP='phpMyAdmin-3.5.0-all-languages.tar.gz';
$APP_ALIAS='phpMyAdmin.phar';
$APP_PREFIX_PATH='phpMyAdmin-3.5.0-all-languages';
$APP_START_PAGE="$APP_PREFIX_PATH/index.php";
@unlink($MYAPP);
copy($SRC_APP, $MYAPP);
$a = new Phar($MYAPP);
$a->startBuffering();
$a["$APP_PREFIX_PATH/config.inc.php"] = '<?php
/* Servers configuration */
$i = 0;
/* Server localhost (config:root) [1] */
$i++;
$cfg[\'Servers\'][$i][\'host\'] = \'localhost\';
$cfg[\'Servers\'][$i][\'extension\'] = \'mysqli\';
$cfg[\'Servers\'][$i][\'connect_type\'] = \'tcp\';
$cfg[\'Servers\'][$i][\'compress\'] = false;
$cfg[\'Servers\'][$i][\'auth_type\'] = \'config\';
$cfg[\'Servers\'][$i][\'user\'] = \'root\';
$cfg[\'Servers\'][$i][\'password\'] = \'secret0\';
/* End of servers configuration */
if (strpos(PHP_OS, \'WIN\') !== false) {
$cfg[\'UploadDir\'] = getcwd();
} else {
$cfg[\'UploadDir\'] = \'/tmp/pharphpmyadmin\';
@mkdir(\'/tmp/pharphpmyadmin\');
@chmod(\'/tmp/pharphpmyadmin\', 0777);
}';
$stub=sprintf("<?php
Phar::interceptFileFuncs();
Phar::webPhar('%s', '%s');
echo 'This application is intended to be executed from a web browser\n';
exit -1;
__HALT_COMPILER();
", $APP_ALIAS, $APP_START_PAGE);
$a->setStub($stub);
$a->stopBuffering();
?>
----- END --------------
----
Server IP: 69.147.83.197
Probable Submitter: 200.58.112.191
----
Manual Page -- http://www.php.net/manual/en/phar.using.intro.php
Edit -- https://master.php.net/note/edit/108414
Del: integrated -- https://master.php.net/note/delete/108414/integrated
Del: useless -- https://master.php.net/note/delete/108414/useless
Del: bad code -- https://master.php.net/note/delete/108414/bad+code
Del: spam -- https://master.php.net/note/delete/108414/spam
Del: non-english -- https://master.php.net/note/delete/108414/non-english
Del: in docs -- https://master.php.net/note/delete/108414/in+docs
Del: other reasons-- https://master.php.net/note/delete/108414
Reject -- https://master.php.net/note/reject/108414
Search -- https://master.php.net/manage/user-notes.php