phpmyadmin blank page - getCookie error when 'php index.php' - php

when accessing the www.hostname/phpmyadmin/ page i get the blank page. Tried to reinstall PHP,HTTPD and MYSQL.
After running php index.php in the phpmyadmin folder I get the following error:
[root#ansible1 phpmyadmin]# php index.php
PHP Fatal error: Uncaught Error: Call to a member function getCookie() on null in /usr/share/phpmyadmin/libraries/classes/Url.php:219
Stack trace:
#0 /usr/share/phpmyadmin/libraries/classes/Url.php(171): PhpMyAdmin\Url::getCommonRaw(Array, '?')
#1 /usr/share/phpmyadmin/libraries/classes/Core.php(762): PhpMyAdmin\Url::getCommon(Array)
#2 /usr/share/phpmyadmin/libraries/classes/Core.php(338): PhpMyAdmin\Core::linkURL('https://secure....')
#3 /usr/share/phpmyadmin/libraries/classes/Core.php(364): PhpMyAdmin\Core::getPHPDocLink('book.json.php')
#4 /usr/share/phpmyadmin/libraries/classes/Core.php(1006): PhpMyAdmin\Core::warnMissingExtension('json', true)
#5 /usr/share/phpmyadmin/libraries/common.inc.php(110): PhpMyAdmin\Core::checkExtensions()
#6 /usr/share/phpmyadmin/index.php(23): require_once('/usr/share/phpm...')
#7 {main}
thrown in /usr/share/phpmyadmin/libraries/classes/Url.php on line 219
On the line 219 in the corresponding file:
public static function getCommonRaw($params = [], $divider = '?')
{
/** #var Config $PMA_Config */
global $PMA_Config;
$separator = Url::getArgSeparator();
// avoid overwriting when creating navi panel links to servers
if (isset($GLOBALS['server'])
&& $GLOBALS['server'] != $GLOBALS['cfg']['ServerDefault']
&& ! isset($params['server'])
&& ! $PMA_Config->get('is_setup')
) {
$params['server'] = $GLOBALS['server'];
}
if (empty($PMA_Config->getCookie('pma_lang')) && ! empty($GLOBALS['lang'])) {
$params['lang'] = $GLOBALS['lang'];
}
$query = http_build_query($params, '', $separator);
if ($divider != '?' || strlen($query) > 0) {
return $divider . $query;
}
Not sure what I am doing wrong but havent found this error on the internet....
The blowfish secret is set:
$cfg['blowfish_secret'] = 'H2OxcGXxflSd8JwrwVlh6KW6s2rER63i';
Any idea what could I be missing? Even a hint what direction to look will be appreciated.
EDIT1:
Downgraded to version 4.9.4 - getting the similar error:
So after downgrading to version 4.9.4 I get the very similar....
[root#ansible1 phpmyadmin]# php index.php
PHP Fatal error: Uncaught Error: Call to a member function getCookie() on null in /usr/share/phpmyadmin/libraries/classes/Url.php:217
Stack trace:
#0 /usr/share/phpmyadmin/libraries/classes/Url.php(169): PhpMyAdmin\Url::getCommonRaw(Array, '?')
#1 /usr/share/phpmyadmin/libraries/classes/Core.php(749): PhpMyAdmin\Url::getCommon(Array)
#2 /usr/share/phpmyadmin/libraries/classes/Core.php(330): PhpMyAdmin\Core::linkURL('https://secure....')
#3 /usr/share/phpmyadmin/libraries/classes/Core.php(353): PhpMyAdmin\Core::getPHPDocLink('book.json.php')
#4 /usr/share/phpmyadmin/libraries/classes/Core.php(987): PhpMyAdmin\Core::warnMissingExtension('json', true)
#5 /usr/share/phpmyadmin/libraries/common.inc.php(106): PhpMyAdmin\Core::checkExtensions()
#6 /usr/share/phpmyadmin/index.php(27): require_once('/usr/share/phpm...')
#7 {main}
thrown in /usr/share/phpmyadmin/libraries/classes/Url.php on line 217
The page now shows: Access Denied - simply written, no pictures or anything.
What am I missing? :/
[Browser view1

I don't know if my previous post is visible, so I post it again:
I had the same error message, and row #4 says: "PhpMyAdmin\Core::warnMissingExtension('json', true)".
After installing php-json package, problem was solved for me.

Related

Tidy class not found

I've been using using Tidy just by enabling its extension in php.ini (in XAMPP, WINDOWS OS)
I'm trying to do the same on XAMPP,macOS by enabling the Tidy extendion in the php.ini which is located in /Applications/XAMPP/xamppfiles/etc/php.ini but I still get php error when i try to instantiate the tidy class:
Fatal error: Uncaught Error: Class "tidy" not found in /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/core/functions.php:48 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/models/user.php(402): truncate('James is a powe...', 200) #1 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/views/joacmedia/temp/us.php(237): User->truncate('James is a powe...', 200) #2 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/views/joacmedia/temp/us.php(283): Page->sectionIntro(Object(stdClass)) #3 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/views/joacmedia/temp/us.php(34): Page->LayoutBottomAream(Object(stdClass)) #4 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/views/joacmedia/temp/us.php(355): Page->__construct(Array) #5 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/core/controller.php(11): include('/Applications/X...') #6 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/views/joacmedia/us.php(5): Controller->view('joacmedia/temp/...', Array) #7 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/core/controller.php(11): include('/Applications/X...') #8 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/controllers/us.php(47): Controller->view('joacmedia/us', Array) #9 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/core/app.php(61): Us->index('jay') #10 /Applications/XAMPP/xamppfiles/htdocs/joacmedia/index.php(6): App->__construct() #11 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/joacmedia/app/core/functions.php on line 48
what should i do to get this error fixed ?
`
//add ellipsis to string
function truncate($html,$length){
$tidy = new tidy();
if ((int)mb_strlen($html,'UTF-8') >= (int)$length ) {
$ellipsis = "<div class='ellipsis_show'>
<div data-href='false' class='text-right see_more_text text-secondary'><strong>...</strong>see more</div>
</div>";
return trim((strip_empty_tag(convert_ENCODE($tidy->repairString("<span data-show-summary='true'>".(NewLineToBreak(substr(trim($html),0,$length)))."</span>"."<span class='text_exposed_hide hide visually_hidden'>".trim(NewLineToBreak(substr($html,$length)))."</span>"),'UTF-8')))).$ellipsis;
}
return trim((strip_empty_tag(convert_ENCODE(tidy_repair_string(NewLineToBreak($html)),'UTF-8'))));
}
`
You are doing a new tidy() in your function and I suspect you do not have the tiny class defined in the same file or namespace. If you use namespaces you shoud do the use your/namespace/to/tiny or you should do a require/include in your functions.php file to include the desired tiny class file.

TYPO3 [7.6.40] installation on localhost error

I tried to install TYPO3 [7.6.40] on my localhost using Xampp on Windows. Unfortunately I couldn't find a solution for my problem. I hope that somebody maybe knows the cause to this issue.
What I did so far:
Installed Xampp and started "Apache" and "MySQL"
Downloaded the TYPO3 [7.6.40] package, unzipped it and copied the files to "C:\xampp\htdocs"
Inside htdocs I created an empty file called "FIRST_INSTALL"
With my browser I tried to access http://localhost but only got warnings and errors
These are the warnings when I try access http://localhost :
Warning: Undefined array key "t3lib/class.t3lib_div.php" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 5095
Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 5095
Warning: Undefined array key "SSL_SESSION_ID" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 3602
Warning: Undefined array key "HTTPS" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 3602
Warning: Undefined array key "HTTPS" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 3602
Warning: Undefined array key "ORIG_SCRIPT_NAME" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 3408
Warning: Undefined array key "systemLog" in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 5053
Warning: Undefined array key 1 in C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php on line 5062
Fatal error: Uncaught Error: Undefined constant "TYPO3\CMS\Core\Error\TYPO3_ERROR_DLOG" in C:\xampp\htdocs\typo3\sysext\core\Classes\Error\ErrorHandler.php:134 Stack trace: #0 C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php(3423): TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Undefined array...', 'C:\\xampp\\htdocs...', 3423) #1 C:\xampp\htdocs\typo3\sysext\core\Classes\Utility\GeneralUtility.php(3566): TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI') #2 C:\xampp\htdocs\typo3\sysext\core\Classes\Error\AbstractExceptionHandler.php(73): TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_U...') #3 C:\xampp\htdocs\typo3\sysext\core\Classes\Error\DebugExceptionHandler.php(50): TYPO3\CMS\Core\Error\AbstractExceptionHandler->writeLogEntries(Object(Error), 'WEB') #4 C:\xampp\htdocs\typo3\sysext\core\Classes\Error\AbstractExceptionHandler.php(45): TYPO3\CMS\Core\Error\DebugExceptionHandler->echoExceptionWeb(Object(Error)) #5 [internal function]: TYPO3\CMS\Core\Error\AbstractExceptionHandler->handleException(Object(Error)) #6 {main} thrown in C:\xampp\htdocs\typo3\sysext\core\Classes\Error\ErrorHandler.php on line 134
And some snippets from GeneralUtility.php (Hope this helps somehow):
GeneralUtility.php line 5094-5097
// Initialize logging
if (!$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit']) {
self::initSysLog();
}
GeneralUtility.php line 3599-3603
if (self::cmpIP($_SERVER['REMOTE_ADDR'], $proxySSL)) {
$retVal = true;
} else {
$retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1';
}
GeneralUtility.php line 3403-3408
switch ((string)$getEnvName) {
case 'SCRIPT_NAME':
$retVal = self::isRunningOnCgiServerApi()
&& ($_SERVER['ORIG_PATH_INFO'] ?: $_SERVER['PATH_INFO'])
? ($_SERVER['ORIG_PATH_INFO'] ?: $_SERVER['PATH_INFO'])
: ($_SERVER['ORIG_SCRIPT_NAME'] ?: $_SERVER['SCRIPT_NAME']);
GeneralUtility.php line 3052-3062
// Init custom logging
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
$params = array('initLog' => true);
$fakeThis = false;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod) {
self::callUserFunction($hookMethod, $params, $fakeThis);
}
}
// Init TYPO3 logging
foreach (explode(';', $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLog'], 2) as $log) {
list($type, $destination) = explode(',', $log, 3);
Thank you in advance!
For me the problem was the wrong PHP version. I needed < 8 and had 8.0.9 or so.
I downloaded the correct XAMPP version with PHP 7.xxx and now it's running. I uninstalled the wrong version first.
Now I can start Typo3 installation.

phantomJs permission denied

Have a question and I have the feeling it should not be to hard to solve but I'm not really familiar with Phantom Js.
$this->phantomProcess($path)->setTimeout(10)->mustRun();
This line results in the following error:
protected function captureImage($view)
{
$path = $this->writeFile($view);
$this->phantomProcess($path)->setTimeout(10)->mustRun();
return $path;
}
protected function writeFile($view)
{
file_put_contents($path = 'storage/' . md5(uniqid()) . '.pdf' , $view);
return $path;
}
protected function phantomProcess($path)
{
return new Process('bin/phantomjs capture.js ' . $path);
}
I'm running the following line:
Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\ProcessFailedException' with message 'The command "bin/phantomjs capture.js storage/7c5b791a0c1f131aac5c5ca272a1c891.pdf" failed. Exit Code: 126(Invoked command cannot execute) Working directory: /Applications/XAMPP/xamppfiles/htdocs/pdf Output: ================ Error Output: ================ sh: bin/phantomjs: cannot execute binary file ' in /Applications/XAMPP/xamppfiles/htdocs/pdf/vendor/symfony/process/Process.php:239 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/pdf/app/Codecourse/Capture/Capture.php(45): Symfony\Component\Process\Process->mustRun() #1 /Applications/XAMPP/xamppfiles/htdocs/pdf/app/Codecourse/Capture/Capture.php(24): Codecourse\Capture\Capture->captureImage('<!DOCTYPE html>...') #2 /Applications/XAMPP/xamppfiles/htdocs/pdf/index.php(17): Codecourse\Capture\Capture->load('invoice.php', Array) #3 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/pdf/vendor/symfony/process/Process.php on line 239
Anybody who can help me out?
Really appreciated,

ReflectionClass in Codeigniter Model

I need to verify the existence of a method in a controller from a model with codeigniter 2.0.2. and HMVC.
I'm trying to do with ReflectionClass:hasMethod(), without success.
My code in Model:
function hasPanel($controller){
$rc = new ReflectionClass($controller);
if($rc::hasMethod("panel_base")){
return true;
}
return false;
}
And the unwelcome error:
Fatal error: Uncaught exception 'ReflectionException' with message 'Class administracion does not exist' in D:\xampp\htdocs\sea\application\models\auth\permisos.php:368
Stack trace:
#0 D:\xampp\htdocs\sea\application\models\auth\permisos.php(368): ReflectionClass->__construct('administracion')
#1 D:\xampp\htdocs\sea\application\models\auth\permisos.php(357): Permisos->hasPanel('administracion')
#2 D:\xampp\htdocs\sea\application\controllers\auth\identificar.php(101): Permisos->getControladores('administracion')
#3 [internal function]: Identificar->modulo()
#4 D:\xampp\htdocs\sea\application\core\Admin_controller.php(317): call_user_func_array(Array, Array)
#5 D:\xampp\htdocs\sea\system\core\CodeIgniter.php(305): Admin_controller->_remap('modulo', Array)
#6 D:\xampp\htdocs\sea\www\index.php(252): require_once('D:\xampp\htdocs...')
#7 {main}
thrown in D:\xampp\htdocs\sea\application\models\auth\permisos.php on line 368
EDITED
This solves the above...
function hasPanel($controller,$route){
include_once($route);
$rc = new ReflectionClass($controller);
if($rc::hasMethod("panel_base")){
return true;
}
return false;
}
But causes this:
Fatal error: Non-static method ReflectionClass::hasMethod() cannot be called statically, assuming $this from incompatible context in D:\xampp\htdocs\sea\application\models\auth\permisos.php on line 373
Some idea?
I'm not entirely sure, but this might be as simple as $rc->hasMethod("panel_base"); You did instantiate a new class. . .
Change
$rc::hasMethod("panel_base")
to
$rc->hasMethod("panel_base")

problem with Zend Exception

I using Zend Gdata library for search video Youtube API.
If I make a bad request, then a zend exception..
Example:
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' in D:\Webserver\domains\loc\controller\Zend\Gdata\App.php:710
Stack trace:
#0 D:\Webserver\domains\loc\controller\Zend\Gdata.php(221): Zend_Gdata_App->performHttpRequest('GET', 'http://gdata.yo...', Array, NULL, NULL, NULL)
#1 D:\Webserver\domains\loc\controller\Zend\Gdata\App.php(876): Zend_Gdata->performHttpRequest('GET', 'http://gdata.yo...', Array)
#2 D:\Webserver\domains\loc\controller\Zend\Gdata\App.php(764): Zend_Gdata_App->get('http://gdata.yo...', NULL)
#3 D:\Webserver\domains\loc\controller\Zend\Gdata\App.php(220): Zend_Gdata_App->importUrl('http://gdata.yo...', 'Zend_Gdata_YouT...', NULL)
#4 D:\Webserver\domains\loc\controller\Zend\Gdata.php(187): Zend_Gdata_App->getEntry('http://gdata.yo...', 'Zend_Gdata_YouT...')
#5 D:\Webserver\domains\loc\controller\Zend\Gdata\YouTube.php(293): Zend_Gdata->getEntry('http://gdata.yo...', 'Zend_Gdata_YouT...')
#6 D:\Webserver\domains\loc\controller\Yo in D:\Webserver\domains\loc\controller\Zend\Gdata\App.php on line 710
But I do not want users of my site have seen this error ... I need to catch this error and cause no Exception and just want to get the text of the error .. What should I do?
Put the code that causes the exception into a try/catch statement
try {
// code calling Zend_Gdata_App->performHttpRequest
} catch(Zend_Gdata_App_HttpException $e) {
$message = $e->getMessage();
// do something with $message now
}
More information: http://de3.php.net/manual/en/language.exceptions.php

Categories