yesterday I got an error on my website, something like "Unable to handle this request". Sadly, I did not backup my website in the last weeks and I didn't want to lose my recent changes by using the backup, so I went to my Webhosts Account and saw that I passed the 50,000 file limit, with about 100 files.
I thought the website's error was because of the host and that they closed my website because I had more than 50,000 files. To fix the problem I deleted the var/caches, var/reports and var/session folders from Magento. The next day, the error still was there. I pasted this code in my .htacces file, to see what the error was:
PHP error handling for development servers
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/path/public_html/domain/PHP_errors.log
[see footnote 3] # php_value error_reporting 999999999
php_value error_reporting -1
php_value log_errors_max_len 0
After pasting the code, my website's error message changed to this:
Warning: include_once(/home/tastatur/public_html/includes/src/Mage_Core_functions.php) [function.include-once0]: failed to open stream: No such file or directory in /home/tastatur/public_html/app/Mage.php on line 36
Warning: include_once() [function.include0]: Failed opening '/home/tastatur/public_html/includes/src/Mage_Core_functions.php' for inclusion (include_path='/home/tastatur/public_html/includes/src:.:/usr/lib/php:/usr/local/lib/php') in /home/tastatur/public_html/app/Mage.php on line 36
Warning: include(/home/tastatur/public_html/includes/src/Mage_Core_Model_App.php) [function.include0]: failed to open stream: No such file or directory in /home/tastatur/public_html/includes/src/Varien_Autoload.php on line 94
Warning: include() [function.include0]: Failed opening '/home/tastatur/public_html/includes/src/Mage_Core_Model_App.php' for inclusion (include_path='/home/tastatur/public_html/includes/src:.:/usr/lib/php:/usr/local/lib/php') in /home/tastatur/public_html/includes/src/Varien_Autoload.php on line 94
Fatal error: Class 'Mage_Core_Model_App' not found in /home/tastatur/public_html/app/Mage.php on line 670
What should I do to fix the errors?
Solved! Go to Solution.
I'm not sure about the 50,000 file limit (that seems a particular configuration from your host).
I saw, for example, this message on your logs:
Failed opening '/home/tastatur/public_html/includes/src/Mage_Core_functions.php' for inclusion
It seems you're using Magento compiler. Maybe you prefer to disable the compiler.
If you can't access using web you can try by shell with this commands (you'll need to enter to the shell directory on your Magento root directory):
php compiler.php state
And you'll see something like:
Compiler Status: Enabled Compilation State: Compiled Collected Files Count: 7943 Compiled Scopes Count: 4
Now we gonna disable the compiler:
php compiler.php disable
The returned message will be:
Compiler include path disabled
Finally, we need to delete the compiled files. We'll do this running the command:
php compiler.php clear
If you execute again this command:
php compiler.php state
The result will be:
Compiler Status: Disabled Compilation State: Not Compiled Collected Files Count: 0 Compiled Scopes Count: 0
Now you've disabled the compiler (is a good idea) and now a lot of files (on my test something about 7k) were deleted (only the compiled files, not the originals)
"If you can access using web you can try by shell with this commands (you'll need to enter to the shell directory on your Magento root directory)"
Hi there, what is Shell and how exactly do I use it?
Sorry, I've edited the answer should be:
"If you can't access using web you can try by shell..."
Now, if you are not sure what shell is, maybe you need to request some technical help to fix this.
The solution that I've mentioned requieres to access to your server and run some command-line commands (because I guess you can't access to your store backend).
I edited includes/config.php and commented out the following lines:
#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src'); #define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
It has worked for me, my website is back, but it didn't work for my friend which helps me with the blog. He refreshed and still got the same error, I had gotten before editing the code.