How to troubleshoot Magento when Developer mode errors out. - php

I'm attempting to troubleshoot a custom module I'm working on. The website seems to work fine with no noticeable or logged errors. When I enable Magento developer mode I get a white screen. This points towards PHP errors.
When I check my server error logs I'm getting the following error:
PHP Fatal error: Class 'Mage' not found in /var/www/index.php on line 41
I'm not exactly sure what to do? Googling hasn't seemed to help much. I'm only getting this error in developer mode.

What version of Magento that you are using? It seems your index.php has been changed.
The best way to debug this, you can:
Compare your files to the freshly downloaded Magento code.
Check index.php on line 41, if there's code calling 'Mage' class
Just FYI, if the code exists and you need it. You can move the code after this code (line 68 on Community 1.8.1)
require_once $mageFilename;
Hope this help.

Try by adding the following line inside index.php at the beginning file.
$_SERVER['MAGE_MODE'] = 'developer';
Hope you will see the error message.

Related

File wp-db.php is deprecated since version 6.1.0! Use wp-includes/class-wpdb.php instead

After an automatic update to my WordPress installation, my website is display this error rather than loading.
Deprecated: File wp-db.php is deprecated since version 6.1.0! Use wp-includes/class-wpdb.php instead. in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5595
Warning: require(/home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/class-wp-dependencies.php): failed to open stream: No such file or directory in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/script-loader.php on line 23
Fatal error: require(): Failed opening required '/home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/class-wp-dependencies.php' (include_path='.:/usr/share/pear/') in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/script-loader.php on line 23
Notice: Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5835
Notice: Function is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5835
There has been a critical error on this website.
Can someone help me understand this error, and provide me a solution or some hints so that I can figure a fix for this.
I also had the same problem currently. So here's how I fixed it.
Go to your Website's App Installer > Wordpress > and find something like this
https://i.stack.imgur.com/xvhm0.png
Click the one in the blue box i drew at the right (Wordpress Manager)
Then, there you can update wordpress
Hope it helped!
i solved it just by updating all plugins, idk why it worked but you can give it a try.

Wordpress error: There has been a critical error on this website. Please check your site admin email inbox for instructions

I'm running a wordpress/woocommerce website running PHP7 on Windows IIS.
After clicking update plugins, I now get the following error when trying to do anything in the WP dashboard (the actual website still works fine, just not when logged in to WordPress):
Fatal error: require_once(): Failed opening required 'C:\inetpub(dir removed)\wordpress\wp-content\plugins\code-snippets/php/admin-menus/class-manage-menu.php' (include_path='.;C:\php\pear') in C:\inetpub(dir removed)\wordpress\wp-content\plugins\code-snippets\code-snippets.php on line 75
Line 75 of the code snippets file is:
/* Load the class */
require_once $class_path . "class-{$class_file}.php";
I tried the recovery email, but just got the message:
Recovery Mode not initialized.
I can't see that may be wrong - any ideas of next steps to try?
Thanks, Mark
I don't know why - but now the site appears to be working. It's as if WP "fixed itself" after a period of time (approx 30 minutes).
So if you get this error - try leaving it for a little while and see if it resolves itself. If anyone knows why/how it can do this, please say. Thanks, Mark

An uncaught Exception was encountered - Require once function - Codeigniter

I moved my codeigniter project from a microsoft azure server on to a new dedicated server. However I am getting nothing but issues. The site worked absolutely perfect on the azure server, none of the files have been changed or anything - but it just don't seem to work.
I first started getting errors saying that the Model can't be found, (i am still trying to fix this)
https://stackoverflow.com/posts/comments/103619729?noredirect=1
and now the latest error i get when going to a different page on my site i get
An uncaught Exception was encountered
Type: ParseError
Message: syntax error, unexpected ''
File: public_html/index.php
Line: 319
Function: require_once
I then looked at index.php and the line in question is :
require_once BASEPATH.'core/CodeIgniter.php';
any ideas what I can do to fix this? is it something to do with how my server is setup? do i need to change something in Apache?
Please help!

My dynamic site is not loading when the site is online but works well in localhost

I'm getting this error when my site is online
[host www.sitename.com] Backend fatal error: PHP Fatal error: require_once() [function.require]: Failed opening required 'admin/config/connection.php' (include_path='.:/opt/cpanel/ea-php53/root/usr/share/pear:/opt/cpanel/ea-php53/root/usr/share/php') in /home/mistrybu/public_html/index.php on line 373\n
The site works well in localhost but when its put online , the dynamic part is not showing.
I changed the php version from php7 to php5 in cpanel. Now the front end is working but the backend is not.
Can someone help me solve this error?
PHP version
Definitely do not go back to PHP5. Keep it to 7. If that means rewriting some of the existing code, so be it, it will make your site more secure and more future proof.
Error Message
Your require_once() method cannot find or access a particular file. This is most probably because:
File missing
The file (connection.php) doesn't exist in the given location (admin/config). Now keep in mind that as the location doesn't start with a /, it's going to be relative to where the require_once() method is being run from.
Since you're running require_once() from:
home/mistrybu/public_html/
it's going to look for the file here:
/home/mistrybu/public_html/admin/config/.
Does that location exist? Does the connection.php reside in the folder?
Folder mismatch
Try adding the following prefix to your path, and see if that makes a difference:
require_once $_SERVER['DOCUMENT_ROOT'].'/admin/config/connection.php';
File errors
Maybe the file exists, but for some reason, gives an error. Try running the following from your command line and see if you get any errors:
php -f admin/config/connection.php

Fatal error: Class 'CI_Controller' not found in H:\php2\htdocs\property\system\core\CodeIgniter.php on line 233

In codeigniter i have started one property related project for my client.
I am getting an error
Fatal error: Class 'CI_Controller' not found in H:\php2\htdocs\property\system\core\CodeIgniter.php on line 233 after i have complete some development.
I have really search it for many time in google and in stackoverflow but still didn't get solved.
Thanks in advance,
Well, m not sure but i guess it can happen because of changes in database settings.
codeigniter sometimes show this very weird behaviour that giving this fatal error "CI_Controller" not found even there's nothing wrong with the core files.
so- try debugging like this-
1)check your database seetings located at config/database.php
2)If it does'nt works, re-uploading the system files.
I hope this helps.
Check your database config in application/config/database.php it's one of the major time consuming error message I faced with CI. Because the error message was simply misleading. So, check the database config first.

Categories