I am getting this error when I run the cron.php for Magento.
[24-Jan-2015 02:40:03 UTC] PHP Fatal error: Class 'Mage__Helper_Data' not found in /home/nli/catalog/app/Mage.php on line 516
I found a few other pages where someone else had this problem but I am unable to fix this. The two underscores must be the issue but I cannot find anywhere in my Magento directories with grep where there is any mention of Mage__Helper_Data or anything calling that class.
Please let me know if you have any ideas on what I could check. This has been happening for at least a couple months so I have no idea what happened or which plugins were installed at the exact time.
Thank you!
-Justin
This should be in one of the config.xml files in your system; it seems like one word is missing between Mage_ and _Helper; btw what is the grep command you are using? try with: grep "Mage__Helper" . -rin , from the top folder. I'm sure you'll find something.
A magento developer was able to take a look at our system and found the issue was within a 3rd party magento plugin that had a corrupt row in the database table that was causing the Mage__Helper_Data error.
Related
Jus tried to log in to my web admin and got this error:
Fatal error: Cannot redeclare oceanwp_webfonts_enqueue() (previously declared in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:94) in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/themes/oceanwp/inc/customizer/controls/typography/webfonts.php on line 128
I can't get acces to the actual site either, any suggestions?
To fix it I manually commented the following functions in /wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:
oceanwp_webfonts_enqueue()
ocean_get_google_font_css()
oceanwp_get_local_webfonts_data_dir()
oceanwp_get_local_webfonts_css_data_dir()
It was a "bad" update, which is now already fixed in 2.0.4 (https://wordpress.org/plugins/ocean-extra/#developers)
After commenting you can update that plugin via the panel or alternatively you can manually update it by removing the folder /wp-content/plugins/ocean-extra/ and uploading again the plugin.
I had the same problem, I got access by changing the theme via in the Database (VIA PHPmyAdmin) for one of the ones that comes by default (like twentytwenty).
I installed a new theme but the whole thing seems unstable still. If nothing better comes up I'm starting a fresh install.
oceanwp_webfonts_enqueue() function declare more than one. this function may be used in loop.
I install this module to magento:
http://www.magentocommerce.com/magento-connect/addshoppers-viral-product-sharing-2577.html
and have problem with my website now:
Fatal error: Class 'Clearcode_Addshoppers_Model_Mysql4_Setup' not found in /data/web/virtuals/49508/virtual/www/includes/src/Mage_Core_Model_Resource_Setup.php on line 234
could you please help me?
Very Very thank you!
Does app/code/<local or community>/Clearcode/Addshoppers/Model/Mysql4/Setup.php exist at all? if it doesn't, you're missing that file. If it does not then try taking a look inside that file and see if the class name is Clearcode_Addshoppers_Model_Mysql4_Setup and not something else.
Path
includes/src
indicated that magento is looking for class in compiled files directory.
Try to run
php shell/compiler.php compile
and try again.
It seems like you have the compiler enabled but it cannot find the (flattened) file.
So either disable the compiler:
php shell/compiler.php disable
Or run a compilation so that it will generate the file for you:
php shell/compiler.php compile
After following the user guide instructions found here: http://ellislab.com/codeigniter/user-guide/general/cli.html I'm unable to run the test script via command line.
My controller located at /var/www/mysite/application/controllers/
class Tools extends CI_Controller {
public function message($to = 'World')
{
echo "Hello {$to}!".PHP_EOL;
}
}
In my browser I can access
http://mysite/tools/message/ben
And the function correctly outputs "Hello ben"
From terminal I should be able to run:
$ php index.php tools message "Ben"
My terminal should print: "Hello Ben"
However I get the following error:
PHP Fatal error: Class 'CI_Controller' not found in /var/www/mysite/system/core/CodeIgniter.php on line 233
My server is pretty standard; ubuntu LAMP. Codeigniter is pretty standard too and I have no problem running non CI scripts via command line
My PHP binary is only located in /usr/bin/php <-- This post suggests an issue running CI directly from usr/bin/php, however I'm not operating a shared PHP service, and I don't see why this would make a difference to how PHP executes a CI script.
Any help or just an indication on how to debug this would be greatly appreciated.
Thanks in advance.
Solved! (partly) the issue was CodeIgniters error logging.
In application/config/config.php, I modified the following config property:
$config['log_threshold'] = 0;
This disables logging, and allows $ php index.php to execute.
If anyone can explain why CI only shows this error on CLI PHP - might help anyone else who has this issue and needs it resolved with error logging on.
To solve error "Class 'CI_Controller' not found" try going to Application -> Config -> database.php then check the database details like hostname, username, password and database.
To Mijahn:
I had this same problem, and after about two hours of tracing through code to figure out the problem, it seems that there is some sort of conflict with loading the CI_Controller when utilizing the native PHP load_class function.
I worked around this issue by making the following changes to the Common.php file (hack, I know).
//$_log =& load_class('Log');
require_once('system/libraries/Log.php');
$_log = new CI_Log();
My logs then where created exactly like I wanted. Hope this hack helps.
This site says to run codeigniter from the command line, one must set the $_SERVER['PATH_INFO'] variable.
$_SERVER['PATH_INFO'] is usually supplied by php when a web request is made. However, since we are calling this script from the command line, we need to emulate this small part of the environment as a web request.
The answer provided in this Stack Overflow post worked for me.
Within system/core/CodeIgniter.php, on around line 75, change:
set_error_handler('_exception_handler');
to...
set_exception_handler('_exception_handler');
Other users have reported that this gave them a better backtrace with which to debug the underlying issue, but for me, this actually removed the problem altogether.
I've been developing WordPress sites for a long time on my local MAMP server. Now all of a sudden, it won't let me create any new sites. Whenever I set up a new one, instead of running the install script I get:
Fatal error: Cannot redeclare class
wpdb in
/Applications/MAMP/htdocs/[my_site]/wp-includes/wp-db.php
on line 52
This happens with all WordPress versions. I cannot thing of anything that would have caused this. I've done everything short of re-install MAMP. Does anyone have any ideas? I'm desperate at this point..
Check out the include path for php. It's likely that a second instance of wordpress is on the include path and is therefore conflicting with the one you're trying to load. It's also possible that a different package on the include path has a class called wpdb and is therefore causing a conflict.
wpdb is being created again some where, if this happened all of a sudden i suggest that you disable any plugins you've recently added. Or even better do a global find for the term class wpdb and see if that appears within more than 1 file. Also, check your functions.php file for a loop that might be loading wp-db.php more than once.
A workaround fix is to wrap the wpdp class in wp-includes/wp-db.php in the following:
Line 52:
if(class_exists('wpdb') != true)
{
class wpdb {
...
}
}
This solved the install issue- You could probably remove it after that, although it can't hurt to leave it I guess.
Still don't understand why this problem has popped up- If someone has an explanation I'd be eager to hear it.
I just updated my project library folder (with an external to ZF svn) to ZF version 1.11. I'm now getting al kinds of weird errors, related to whitespaces, empty lines, etc. I searched on the internet for quite a while, but can't find a proper answer. I think this is related to some settings in my php.ini file but can't figure it out.
Example of an error:
Parse error: syntax error, unexpected $end in /library/Zend/Application.php on line 415 Call Stack: 0.0042 657160 1. {main}() /mnt/hgfs/htdocs/service/public/index.php:0
PHP version: PHP 5.3.5-0.dotdeb.1
All help would appreciated, I can't wrap my head around it!
I see you're running the project on a hgfs mount, probably inside your VM. Try to run your project off the hgfs mount as I found it to be buggy when dealing with these things.
For one, the default mount options don't keep into account that your file and directory properties (uid and gid) probably aren't the same on your guest and host system. Unfortunately, setting these right didn't fix it for me.
The solution I eventually used was to ditch the hgfs driver and mount the files using sshfs. On Debian you can just install it by running apt-get install sshfs. I then added an entry to /etc/fstab, like this:
sshfs#user#host:/path/to/host/dir /mnt/share fuse comment=sshfs,user,rw,exec,uid=1000,gid=1000,allow_other 0 0
Mounting the share can then be done by running this:
mount /mnt/share
Hope this helps!