Home >Backend Development >PHP Tutorial >After installing magento, it prompts: HTTP ERROR 500, how to solve it?

After installing magento, it prompts: HTTP ERROR 500, how to solve it?

不言
不言Original
2018-05-18 16:58:163598browse


I installed magento2 on ubuntu14, and the apache prompt can be displayed when accessing http://localhost/. It Works! , but http://localhost/magento2/ prompts HTTP ERROR 500
I installed it using the following command:

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

After the error, I checked the php error log and the prompt is as follows:

[Thu Sep 08 11:03 :34.275419 2016] [:error] [pid 2214] [client 127.0.0.1:41732] PHP Fatal error: Uncaught exception 'MagentoFrameworkExceptionFileSystemException' 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): MagentoFrameworkFilesystemDriverFile->deleteFile('/var/www/html/m...') n#1 /var/www/html/magento2/vendor/magento/framework/Code/GeneratedFiles.php(98): MagentoFrameworkFilesystemDirectoryWrite->delete('/var/.regenerat...')n#2 /var/ www/html/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(114): MagentoFrameworkCodeGeneratedFiles->cleanGeneratedFiles()n#3 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap. php(385): MagentoFrameworkAppObjectManagerFactory->create(Array)n#4 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(362): MagentoFrameworkAppBootstra in /var/www/html/magento2 /vendor/magento/framework/Filesystem/Driver/File.php on line 382

How to solve this situation? It allows me to install magento normally

Reply content:

I installed magento2 on ubuntu14, and the web page access http://localhost/ can display the apache prompt. It Works! , but http://localhost/magento2/ prompts HTTP ERROR 500
I installed it using the following command:

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

After the error, I checked the php error log and the prompt is as follows:

[Thu Sep 08 11:03 :34.275419 2016] [:error] [pid 2214] [client 127.0.0.1:41732] PHP Fatal error: Uncaught exception 'MagentoFrameworkExceptionFileSystemException' 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): MagentoFrameworkFilesystemDriverFile->deleteFile('/var/www/html/m...') n#1 /var/www/html/magento2/vendor/magento/framework/Code/GeneratedFiles.php(98): MagentoFrameworkFilesystemDirectoryWrite->delete('/var/.regenerat...')n#2 /var/ www/html/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(114): MagentoFrameworkCodeGeneratedFiles->cleanGeneratedFiles()n#3 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap. php(385): MagentoFrameworkAppObjectManagerFactory->create(Array)n#4 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(362): MagentoFrameworkAppBootstra in /var/www/html/magento2 /vendor/magento/framework/Filesystem/Driver/File.php on line 382

How to solve this situation? It allows me to install magento normally

Try to install the package directly from the official website

Permission denied

Insufficient permissions. Make sure that the ./var directory is writable. It is best that the owner of the directory where the project is located belongs to apache
chown -R apache: apache ./

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn