Magento connect manager showing blank page - php

I am running a magento site but when i click on magento connect manager. it displays blank page. i have enabled error mode but it doesn't show any error or no log as well

You have another option , paste the extension key in below link and get the extensions files and install it manually :
http://freegento.com/ddl-magento-extension.php

Whenever this happens the first thing I check is the PHP memory limit.
Magento overrides the normal error handler with it's own, but when the error is "Out of memory" that custom handler cannot run, so nothing is seen.
And Other Suggestion
I was also facing this error. The error has been fixed by changing content of core function getRowUrl in app\code\core\Mage\Adminhtml\Block\Widget\Grid.php The core function is :
public function getRowUrl($item)
{
$res = parent::getRowUrl($item);
$res = parent::getRowUrl($item);
}
Replaced with :
public function getRowUrl($item)
{
return $this->getUrl(’*/*/edit’, array(’id’ => $item->getId()));
}

Related

Invalid Run Id After running drupal page using XHProf

I have installed the Drupal XHProf 7.x-1.0-beta2 module and enabled it on the Modules page of my site.
I have turned enabled the use of the module at Configuration -> Development -> XHProf settings (/admin/config/development/xhprof) by checking ON " Enable profiling of all page views and drush requests. "
Now what?
When I visit a page and click "XHProf output" at the bottom of the page, I get this error:
" Run #51b789ae8cea0: Invalid Run Id = 51b789ae8cea0 "
And the list of the "Top 100 functions" is totally empty. I am a bit lost as to what I should be seeing or where to go from here. Any help greatly appreciated.
please refer error screenshot
Go to your backend folder structure.create a folder named xhprof in your server, inside tmp folder in your server like 10.20.4.123/tmp
on clicking "XHProf output" at the bottom of the page.it will display output.
Looking at the code that returns this error it's a file exists check. I changed $run_desc to output the full filename vs the run id.
if (!file_exists($file_name)) {
xhprof_error("Could not find file $file_name");
$run_desc = "Invalid Run Id = $file_name";
return null;
}
In my case for a run id of 617064cfe0f71 it was looking for a filename formatted like
617064cfe0f71.xhprof.xhprof
The filename is derived from this function
private function file_name($run_id, $type) {
$file = "$run_id.$type." . $this->suffix;
...
}
It's a permission issue,just set chmod 777 for your xhprof output directory.

Cakephp never ending request

I'm quite new to cakephp and trying to debug a code from someone else.
The problem is I get a never ending request, despite the fact that both view and crontroller seem to run properly. I even tryed to add an exit; in both of them or even introduce a syntax error in the controller, the request never ends and the browser keeps trying to load the page endlessly.
Here is the code of the controller :
public function categories()
{
file_put_contents("/tmp/logfile.log",time()." categories bla\n", FILE_APPEND);
$catData = $this->SpecificKeywordCategorie->find('all');
$modelnameLessValues = array();
foreach($catData as $singleCat)
{
$modelnameLessValues[] = $singleCat['SpecificKeywordCategorie'];
}
$this->set('categories',$modelnameLessValues);
file_put_contents("/tmp/logfile.log",time()." categories end blu\n", FILE_APPEND);
}
and the view code "categories.ctp :
<?php
file_put_contents("/tmp/logfile.log","view json ".json_encode($categories),FILE_APPEND);
print(json_encode($categories));
file_put_contents("/tmp/logfile.log","view json before exit",FILE_APPEND);
exit;
?>
all the file_put_contents entries are written in the logfile. but the exit seems to be ignored and if I do a request in a browser it never ends...
Same thing happens if I add a syntax error on controller or view. (of course, in this case, log entries are not written)
I know nothing about cakephp internals, but php scripts running outside it are running well on same apache instance.
Any idea where to look to find where this infinite request comes from ?
We are running cakephp 2.2.3

MySQLi Transaction Server gone away

I use the following code to insert some orders in the DB with a mysqli transaction. Sometime it works without any problems and sometime it just throws an error after 1 minute saying: "Mysqli Server gone away". When I trigger the same thing just after the error it just works.
The php file is trigger via jquery post.
function InsertOrder($children){
global $mysqli;
foreach($children as $child){
InsertOrder();
}
}
require('../../sys/connect.php');
$mysqli->autocommit(FALSE);
$error = false;
foreach($_POST){
InsertOrder($children);
}
if(!$error)
{
$mysqli->commit();
die("done");
} else
{
$mysqli->rollback();
die(getLanguageKey("label_mysqli_rollback",array($error)));
}
It's just a light version of my code, but that's it.
If I remove "$mysqli->autocommit(FALSE);" it works all the time.
It also works in other recursive functions I use.
You can log in at ur.ready2order.at with the demo account button. Then you can call:
http://ur.ready2order.at/views/order.dev.php?t_id=155
This site uses the mentions script. Sometime mysqli server gone away...sometime not.
Clicking the white button puts the product to order list and blue part of button opens the sidedishes and comment function.
Thanks in advance
There is documentation about it: MySQL server has gone away
Try to change your wait_timeout or increase speed of your script.
I found the issue. As I rebuild my code from using mysql to mysqli, I forgot to rewrite a small function. This caused the error because it was still looking for mysql().
Sorry guys and thanks.

PHP Trait method works only on first load

I'm using MAMP with PHP 5.4.10 and I have a problem with the following MWE:
<?php
trait T {
public function hello() { echo 'hello'; }
}
class A {
use T;
}
$a = new A();
$a->hello();
?>
The page shows 'hello' on the first load. But then, when I hit refresh, I get an Error 500.
If I modify the file (just by adding an empty line somewhere for instance) and refresh again, 'hello' shows up again. Hit refresh again, and the Error 500 is back.
Any clue where this might be coming from?
Update:
This shows up in the PHP errors log (nothing in the Apache errors log): PHP Fatal error: Call to undefined method A::0?
()
(the 0 doesn't always have the same name when I repeat the operation).
Xcache might be the problem here, try turning caching off (or at least xcache) and try it again
I had the same problem, and thanks to the #Leon Weemen i focused on the XCache. I found this bug (which is fixed in XCache 3.0.1) to be exactly what causes the problem (my version of XCache was 2.0.0). They suggest you to set in your php.ini the following values to solve the problem;
xcache.mmap_path = "/tmp/xcache"
xcache.readonly_protection = on
However, this workaround does not solve the problem for me. The only way I was able to disable the XCache was by using the ini_set() PHP method. The following snippet at the very begginning of my application solves the problem and is ready to use XCache as soon as it is updated:
try{
$xCache = new ReflectionExtension('xcache');
if(version_compare($xCache->getVersion(), '3.0.1', '<')){
ini_set('xcache.cacher', 0);
}
} catch(ReflectionException $e){
// xCache not installed - everything should work fine
}

CakePHP - Can CakeLog::write() break further code execution?

A login function writes a couple of session variables after successful authentication and then redirects to itself to print a welcome message (the view changes based on authentication status). This works fine with debug >= 0.
Now, when I add a CakeLog::write() to that same login function, it stops working with debug = 0 and an empty page is displayed. It continues working with debug > 0.
According to the Apache logs, the white page is the result of an error 500 following a POST request.
What does CakeLog::write() do apart from writing to a log file?
'Session', 'Security' and 'Auth' components are involved, but I do not call the requirePost method.
CakeLog::write() returns true if successful but catching the return code doesn't change the issue that further code execution is interrupted. I have to reload the white page in order to continue (i.e. replace the POST with a GET request).
Here is the users_controller's login:
function login(){
[if form contains data do some LDAP checking...]
if($permission>0){
$this->Session->write('logname', $samaccountname);
$this->Session->write('logperm', $permission);
[...]
// Here is where it blocks. Without this line debug=0 is okay
$result = CakeLog::write('log', $samaccountname);
$this->Auth->login();
// the Auth redirect target is set in the app_controller to allow jumping right
// to the originally intended URL, usually it redirects to itself
$this->redirect($this->Auth->redirect());
}
}
And this is the app_controller's beforeFilter:
function beforeFilter(){
$this->Security->blackHoleCallback = 'showErrorPage';
$this->Security->requireAuth();
$this->Security->requireSecure();
if($this->Session->read('logperm') < 1 && $this->here != '/users/login'){
$this->Auth->redirect($this->here); // store chosen URL
$this->redirect('/users/login');
}
if($this->Session->read('logperm') == 3)
$this->Auth->allow('*');
elseif[...]
}
This is a long shot, but 'log' is not a valid log type so you could try again with something like 'notice'.
The only other thing I can think of is that the log file directory is not writeable by PHP. You could check that also.
Thanks #François, that pointed me into the right direction.
It was necessary to set
Configure::write('log', true);
to ensure that message and error logging works even if debug=0 (added this in bootstrap).
By the way the 1.3 cookbook exlicitely states that logging is enabled by default even if debug=0. That might be a glitch in the documentation.

Categories