0
votes

Hi I am trying to install magento 1.9.x and magento2 in my centos operating system.. the following links help to configure apache2.4, php7 and mysql5.7 in centos.

Install magento link

after configure web server, php, mysql, magento files and all. I create database for magento2. Based on above link i did all steps one-by-one. After i run in browser localhost/magento2/

it show 500 Internal server error in firebug and blank browser.

I am beginner of centos and magento

Please any one help how to solve this problem i was spend past two days.

Apache error log:

[Sat Sep 10 14:22:33.728848 2016] [:error] [pid 2809] [client ::1:45432] PHP Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/var/www/html/magento2/var/page_cache" is not writable in /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache.php:209\‌​nStack trace:\n#0 /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache/Backend/‌​File.php(180): Zend_Cache::throwException('cache_dir "/var...')\n#1 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-‌​file/File.php(87):

Zend_Cache_Backend_File->setCacheDir('/var/www/html/m...')\n‌​#2 /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache.php(153)‌​: Cm_Cache_Backend_File->__construct(Array)\n#3 /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)\n#4

/var/www/html/magento2/lib/internal/Magento/Framework/App/Ca‌​che/Frontend/Factory‌​.php(158): Zend_Cache::factory('Magento\\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true)\n#5 /var/www/html/magento2/lib/internal/Magento/Framework/App/Ca‌​che/Frontend in /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache.php on line 209

1
The error is related to Apache and It is impossible to know without looking at the Apache logs. Refresh the page `localhost/magento2, check the /var/log folder and search for the Apache logs. Also this question would be more meaningful in ServerFault instead of StackOverflow. - Marcs
@Marcs I check in var/log directory.. i found httpd folder inside i saw access_log file it contains following error ::1 - - [10/Sep/2016:11:12:05 +0530] "GET /magento2/ HTTP/1.1" 500 - "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0".... - Kumar Shanmugam
You need to check the error_log, check the docs about error logging on the apache docs: httpd.apache.org/docs/2.4/logs.html - Marcs
[Sat Sep 10 14:22:33.728848 2016] [:error] [pid 2809] [client ::1:45432] PHP Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/var/www/html/magento2/var/page_cache" is not writable in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php:209\nStack trace:\n#0 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...')\n#1 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(87): - Kumar Shanmugam
Zend_Cache_Backend_File->setCacheDir('/var/www/html/m...')\n#2 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array)\n#3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)\n#4 - Kumar Shanmugam

1 Answers

1
votes

To me this look like the main problem:

Uncaught Zend_Cache_Exception: cache_dir "/var/www/html/magento2/var/page_cache" is not writable in /var/www/html/magento2/vendor/magento/zendframework1/library‌​/Zend/Cache.php:209\‌​nStack

You have the wrong permissions or wrong owner for this folder. You can fix this using chown for fixing the owner of that folder or chmod for fixing writing permissions for that folder.

Try this:

chown -R apache.apache /var/www/html/magento2/

This sets the whole magento2 folder to have apache as owner and group. It is not the best security measure but for testing is fine.