Many users encounter some weird Magento 500 Internal Server Errors (Error type 500). I will try to list the most common solutions. These errors are not always caused by the same reason. You should try to take a look at your server’s error logs to get some help about this error.
You can get additional info about the errors by Turning on Developer Mode. Look in the Magento bootstrap file (index.php), you’ll see lines similar to the following
#Mage::setIsDeveloperMode(true); #ini_set(‘display_errors’, 1);
Uncomment these. In a production system, you’d never want to have your errors display to the browser, but while developing having an errors and warnings thrown immediately in your face is invaluable. This way, you will see the actually problem which lead to the Internal Error Server. In almost cases, the reason is that there is an exception throw after output is sent to browser.
Solution #1
This error might be caused because you have not set the correct permissions for the magento folders. To solve this go to File Manager and then change the file permission of index.php file from 664 to 644. Also change the permissions of downloader/index.php file to 644 as well otherwise when you will try to access System > Magento Connect >Magento Connect Manager (after magento installation) by logging to magento admin, you will get 500 Internal Server Error.
You can also try this tool, it’s a magento cleanup utility. It will set the correct permissions for your complete magento installation:
- Download it
- Unzip magento-cleanup.php to the root directory of your magento installation
- Browse to http://yourdomain.com/magento/magento-cleanup.php
<?php ## Function to set file permissions to 0644 and folder permissions to 0755 function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ $d = new RecursiveDirectoryIterator( $dir ); foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){ if( $path->isDir() ) chmod( $path, $dirModes ); else if( is_file( $path ) ) chmod( $path, $fileModes ); } } ## Function to clean out the contents of specified directory function cleandir($dir) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && is_file($dir.'/'.$file)) { if (unlink($dir.'/'.$file)) { } else { echo $dir . '/' . $file . ' (file) NOT deleted!<br />'; } } else if ($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) { cleandir($dir.'/'.$file); if (rmdir($dir.'/'.$file)) { } else { echo $dir . '/' . $file . ' (directory) NOT deleted!<br />'; } } } closedir($handle); } } function isDirEmpty($dir){ return (($files = @scandir($dir)) && count($files) <= 2); } echo "----------------------- CLEANUP START -------------------------<br/>"; $start = (float) array_sum(explode(' ',microtime())); echo "<br/>*************** SETTING PERMISSIONS ***************<br/>"; echo "Setting all folder permissions to 755<br/>"; echo "Setting all file permissions to 644<br/>"; AllDirChmod( "." ); echo "Setting pear permissions to 550<br/>"; chmod("pear", 550); echo "<br/>****************** CLEARING CACHE ******************<br/>"; if (file_exists("var/cache")) { echo "Clearing var/cache<br/>"; cleandir("var/cache"); } if (file_exists("var/session")) { echo "Clearing var/session<br/>"; cleandir("var/session"); } if (file_exists("var/minifycache")) { echo "Clearing var/minifycache<br/>"; cleandir("var/minifycache"); } if (file_exists("downloader/pearlib/cache")) { echo "Clearing downloader/pearlib/cache<br/>"; cleandir("downloader/pearlib/cache"); } if (file_exists("downloader/pearlib/download")) { echo "Clearing downloader/pearlib/download<br/>"; cleandir("downloader/pearlib/download"); } if (file_exists("downloader/pearlib/pear.ini")) { echo "Removing downloader/pearlib/pear.ini<br/>"; unlink ("downloader/pearlib/pear.ini"); } echo "<br/>************** CHECKING FOR EXTENSIONS ***********<br/>"; If (!isDirEmpty("app/code/local/")) { echo "-= WARNING =- Overrides or extensions exist in the app/code/local folder<br/>"; } If (!isDirEmpty("app/code/community/")) { echo "-= WARNING =- Overrides or extensions exist in the app/code/community folder<br/>"; } $end = (float) array_sum(explode(' ',microtime())); echo "<br/>------------------- CLEANUP COMPLETED in:". sprintf("%.4f", ($end-$start))." seconds ------------------<br/>"; ?>
Solution #2
Your server does not support some of the magento specifications. You can easily test this using the magento check utility. Follow the steps below to check your server’s software, if there is an incompatibility this utility will show it.
- Download it
- Unzip magento-check.php to the root directory of your magento installation
- Browse to http://yourdomain.com/magento/magento-check.php
<? extension_check(array( 'curl', 'dom', 'gd', 'hash', 'iconv', 'mcrypt', 'pcre', 'pdo', 'pdo_mysql', 'simplexml' )); function extension_check($extensions) { $fail = ''; $pass = ''; if(version_compare(phpversion(), '5.2.0', '<')) { $fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater)</li>'; } else { $pass .='<li>You have<strong> PHP 5.2.0</strong> (or greater)</li>'; } if(!ini_get('safe_mode')) { $pass .='<li>Safe Mode is <strong>off</strong></li>'; preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version); if(version_compare($version[0], '4.1.20', '<')) { $fail .= '<li>You need<strong> MySQL 4.1.20</strong> (or greater)</li>'; } else { $pass .='<li>You have<strong> MySQL 4.1.20</strong> (or greater)</li>'; } } else { $fail .= '<li>Safe Mode is <strong>on</strong></li>'; } foreach($extensions as $extension) { if(!extension_loaded($extension)) { $fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>'; } else{ $pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>'; } } if($fail) { echo '<p><strong>Your server does not meet the following requirements in order to install Magento.</strong>'; echo '<br>The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:'; echo '<ul>'.$fail.'</ul></p>'; echo 'The following requirements were successfully met:'; echo '<ul>'.$pass.'</ul>'; } else { echo '<p><strong>Congratulations!</strong> Your server meets the requirements for Magento.</p>'; echo '<ul>'.$pass.'</ul>'; } } ?>
Solution #3
If you are getting weird 500 internal server errors on specific pages of your site, it might be a matter of resources. I was getting internal server erros on some product pages and on the http://yourdomain.com/checkout/onepage. I found out that the .htacess file of my magento installation was somehow reset and the php_value memory_limit value was set to 32M as soon as I raised it, the internal server errors vanished! You should use at least 256M for over 600-700 SKUs. Magento is very resource hungry and it is easy to get these kind of errors if you try to save some bucks from the hosting.
Solution #4
Htaccess file which is located at Magento root folder. It will be this case if you meet Internal Server Error on every page. Try to remove it for testing purpose
If your website was running file for a long time, then it must be a change at Server side, just submit a ticket to Hosting Company.
Solution #5 (Comment from Huberto)
If the curl extension is missing you can get 500 Internal server error. You can install it using the command below:
apt-get install curl libcurl3 libcurl3-dev php5-curl
from: http://www.techjam.gr/2012/magento/solve-magento-500-internal-server-errors/
相关推荐
对于首次安装magento过程中出现的问题的小结
magento 500元购买的模板 很不错的,值得收藏
magento入门原版书.。。The Definitive Guide to Magento.pdf
Chapter 2, Magento 2 System Tools, explains how to install Magento 2 via the command shell. Magento released a new powerful tool to manage and install sample data, reindex your database, back up your ...
Chapter 2, Magento 2 System Tools, explains how to install Magento 2 via the command shell. Magento released a new powerful tool to manage and install sample data, reindex your database, back up your ...
Apress.The.Definitive.Guide.to.Magento.Dec.2009.pdf Apress于2009重磅推出的Magento上手书籍,原书地址:http://www.apress.com/book/view/9781430272298
magento500买的模板免费下载
You’ll start by getting a general understanding of what Magento is, why and how you should use it, and whether it is possible and feasible to migrate from an old web store to Magento 2. As you work ...
magento数据结构分析 magento数据字典
magento的SMTP插件magento的SMTP插件magento的SMTP插件
概述该存储库包含将Magento 2与TurnTo的Social Commerce服务连接的Magento 2扩展。 与Magento社区和企业版2.1.x-2.3.x兼容。安装说明使用Composer安装(推荐) 在您的Magento根安装目录中运行以下命令: composer ...
magik shoes magento 模板, magento 1.7 模板
Get a hands-on introduction to custom shipping and payment methods ☆ 出版信息:☆ [作者信息] Branko Ajzele [出版机构] Packt Publishing [出版日期] 2013年09月25日 [图书页数] 128页 [图书语言] 英语...
Magento插件开发手册 Magento Extension Developers Guide
深入理解Magento 由精东博客下载下来制作成pdf
主要包括的内容有:magento的常用设置、Magento模板制作教程、Magento商城_目录结构说明、Magento中文教程实用文档、常用的xml的文件的作用以及自定义模块的应用
Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全自定义,一键安装演示,小工具化横幅系统,颜色选择,MEGA菜单,多商店支持,自定义产品...
magento2 developers cookbook, magento 开发手册,magento教程
快速在服务器上复制为另一个站,版本用的是magento,php语言