2016-01-08 114 views
1

我在我的服务器上安装Magento 2.0.0版本。我得到500错误,甚至没有配置它。尝试各种解决方案得不到积极的回应应用检查和清理文件和接收这些消息:错误500安装Magento

检查:

Your server does not meet the following requirements in order to install Magento. 
The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento: 

You need MySQL 4.1.20 (or greater) 

The following requirements were successfully met: 
You have PHP 5.2.0 (or greater) 
Safe Mode is off 
You have the curl extension 
You have the dom extension 
You have the gd extension 
You have the hash extension 
You have the iconv extension 
You have the mcrypt extension 
You have the pcre extension 
You have the pdo extension 
You have the pdo_mysql extension 
You have the simplexml extension 

清理:

----------------------- CLEANUP START ------------------------- 

*************** SETTING PERMISSIONS *************** 
Setting all folder permissions to 755 
Setting all file permissions to 644 
Setting pear permissions to 550 

****************** CLEARING CACHE ****************** 

************** CHECKING FOR EXTENSIONS *********** 
-= WARNING =- Overrides or extensions exist in the app/code/local folder 
-= WARNING =- Overrides or extensions exist in the app/code/community folder 

------------------- CLEANUP COMPLETED in:2.6845 seconds ------------------ 

在它说我没有那个版本的MySQL上检查文件我服务器。添加以下代码,看看我有一个版本,这就是答案:

echo "<h2>Exact Version PHP & MySQL: </h2>"; 
printf("PHP version: %s\n", PHP_VERSION); 
$mysql = mysqli_connect('localhost', 'root', 'example'); 
#$mysql = mysqli_connect('localhost', 'root', ''); 
## Test the MySQL connection 
if (mysqli_connect_errno()) { 
    printf("</br> Connection failed: %s\n", mysqli_connect_error()); 
    exit(); 
} 
## Print the MySQL server version 
printf("</br> MySQL server version: %s\n", mysqli_get_server_info($mysql)); 
##Close the MySQL connection 
mysqli_close($mysql); 

结果:

Exact Version PHP & MySQL: 

PHP version: 5.5.30-1~dotdeb+7.1 
MySQL server version: 5.6.15 

编辑

错误日志我的服务器

[Fri Jan 08 12:02:44 2016] [error] [client 200.111.332.174] PHP Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory /home/nhernandez/public_html/editorialauncreemos/var/generation/Magento/Framework/App/ResourceConnection/.' in /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/Code/Generator.php:103\nStack trace:\n#0 /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...')

1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...')

2 [internal function]: spl_autoload_call('Magento\\Framewo...')

3 /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')

4 /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Fram in /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/Code/Generator.php on line 103

+2

我有一个关闭选项**不能被困扰从屏幕上读取错误**的前两行? – RiggsFolly

+0

除OP列出“MySQL服务器版本:5.6.15”的底部外。好奇。除非OP不使用本地主机作为Magneto DB。 – aynber

+0

这将是显而易见的,但我的服务器上安装了更高版本。 – NHTorres

回答

0

自从您提到之后,magento商店加载权限,我们可以得出结论,mysql数据库连接没有问题。

您的服务器日志确切地告诉问题是什么。确保magento根目录,子目录和所有文件的所有权按照apache(httpd.conf)UserGroup

在我的框中,用户是http,组是http。问题下面的命令,其中$MAGENTO_ROOT是你的Magento的根目录:

$ chown http:http * -R 
$ cd $MAGENTO_ROOT 
$ sudo rm var/{cache,session,generation} -R 
$ sudo -u http -g http bin/magento setup:upgrade 
$ sudo -u http -g http bin/magento setup:di:compile 

如果您正在使用php-fpm然后确保php-fpm.ini具有相同usergroup值。