错误500安装Magento

时间:2016-01-08 14:58:31

标签: php mysql magento

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

检查:

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] [错误] [客户端200.111.332.174] PHP致命错误:未捕获异常&#39; Magento \ Framework \ Exception \ LocalizedException&#39;有消息&#39;无法创建目录/home/nhernandez/public_html/editorialauncreemos/var/generation/Magento/Framework/App/ResourceConnection/.'在/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-&gt; generateClass(&#39; Magento \\ Framewo ...&#39;)

     

1 [内部功能]:Magento \ Framework \ Code \ Generator \ Autoloader-&gt;加载(&#39; Magento \\ Framewo ...&#39;)

     

2 [内部功能]:spl_autoload_call(&#39; Magento \\ Framewo ...&#39;)

     

3 /home/nhernandez/public_html/editorialauncreemos/vendor/magento/framework/Code/Reader/ClassReader.php(19):ReflectionClass-&gt; __ construct(&#39; Magento \\ Framewo ...&#39 ;)

     

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

1 个答案:

答案 0 :(得分:0)

由于您提到magento存储在获得777权限后加载,我们可以得出结论,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值。