php - 安装magento之后提示:HTTP ERROR 500,请问怎么解决?
大家讲道理
大家讲道理 2017-04-11 10:15:40
[PHP讨论组]

我在ubuntu14上安装了magento2,网页访问http://localhost/能够显示apache的提示It Work!,但是http://localhost/magento2/提示HTTP ERROR 500
我是使用以下的命令安装的:

apt-get update
apt-get install git wget
wget -O /usr/local/bin/composer http://getcomposer.org/composer.phar
chmod +x /usr/local/bin/composer
cd /var/www
git clone https://github.com/magento/magento2.git
cd /var/www/magento2
composer install

出错之后,我查了php的错误日志,提示如下:

[Thu Sep 08 11:03:34.275419 2016] [:error] [pid 2214] [client 127.0.0.1:41732] PHP Fatal error: Uncaught exception 'Magento\Framework\Exception\FileSystemException' with message 'The file "/var/www/html/magento2/var/.regenerate" cannot be deleted Warning!unlink(/var/www/html/magento2/var/.regenerate): Permission denied' in /var/www/html/magento2/vendor/magento/framework/Filesystem/Driver/File.php:382nStack trace:n#0 /var/www/html/magento2/vendor/magento/framework/Filesystem/Directory/Write.php(173): Magento\Framework\Filesystem\Driver\File->deleteFile('/var/www/html/m...')n#1 /var/www/html/magento2/vendor/magento/framework/Code/GeneratedFiles.php(98): Magento\Framework\Filesystem\Directory\Write->delete('/var/.regenerat...')n#2 /var/www/html/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(114): Magento\Framework\Code\GeneratedFiles->cleanGeneratedFiles()n#3 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(385): Magento\Framework\App\ObjectManagerFactory->create(Array)n#4 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(362): Magento\Framework\App\Bootstra in /var/www/html/magento2/vendor/magento/framework/Filesystem/Driver/File.php on line 382

请问这个情况该如何解决?能让我正常安装magento

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回复(2)
PHPz

直接官网下安装包试试

PHP中文网

Permission denied

权限不足,要确保./var目录可写,最好是项目所在目录的owner都属于apache
chown -R apache:apache ./

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号