cancel
Showing results for 
Search instead for 
Did you mean: 

Struggling to install Magento CE 2.1.6 on CentOS

SOLVED

Struggling to install Magento CE 2.1.6 on CentOS

I have been struggling installing Magento CE 2.1.6.

 

Summary of the problem:

  • Easy Web Install Wizard hangs on 0%, at the Installing deployment configuration...
  • Command line installation was successful, but not able to visit store admin site or the shop frond end. A HTTP error 500 was received and the error_log file in the magento install folder has an entry for Fatal PHP error: out of memory.

Details of the server and steps taken are as below.

 

Server:

CentOS 6.9

PHP 5..6.30

MySQL 5.6.35

Apache: 2.4.25

PHP maximum memory: 768M

 

domain root directory: /home/meuser/public_html (meuser is the the user name)

 

I am doing a clean install, by following the steps below:

  1. create a new database named magento
  2. create a magento directory under public_html (and remove the group write permission for the newly created directory)
  3. copy the magento zip file to the magento folder and unzip it
  4. follow the steps to set the ownership and permissions for the shared group

 

find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chmod u+x bin/magento

I did not change the ownship since the magento files have the same ownership as exist HTML/PHP files under public_html, which work fine.

 

I then tried to install Magento via the Easy Web Install Wizard, however the wizard hangs at the last step, showing installing 0%, with log showing Installing deployment configuration...

 

So I decided to try command line install. I deleted the whole magento directory,and started again by repeating the step above (including drop and recreate the database magento). This time I was using command line to install Magento with the following command:

 

 

export PATH=$PATH:/home/meuser/public_html/magento/bin
php magento setup:install --admin-firstname=<fname> \
--admin-lastname=<sname> --admin-email=<email> \
--admin-user=<name> --admin-password=<password> \
--db-host=localhost --db-name=magento --db-user=root --db-password=<rootpassword> \
--base-url=http://www.<domain>.com/magento/ --use-rewrites=1 

 

The installation went smoothly without any problem, showing the following message

 

Post installation file permissions check...
For security, remove write permissions from these directories: '/home/meuser/public_html/magento/app/etc'
[Progress: 424 / 425]
Write installation date...
[Progress: 425 / 425]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_bcekzb

 

So I removed the write permissions for the app/etc folder as instructed.

I then open a browser from another PC with URL http://www.<domain>.com/magento/admin_bcekzb/, The web page show

 

The www.<domain>.com page isn’t working

www.<domain>.com is currently unable to handle this request.
HTTP ERROR 500

 

From the magento directory, where Magento was installed, the error_log shows

 

 

[02-May-2017 23:05:52 UTC] PHP Fatal error:  Out of memory (allocated 20709376) (tried to allocate 64 bytes) in /home/meuser/public_html/magento/vendor/magento/framework/Config/Converter/Dom/Flat.php on line 124
error_log (END)

Does anyone have any suggestion what went wrong here? I have no idea where this limit of 20709376 (just under 20MB) come from. I have set PHP memory limit to 768MB.

 

I have also modified the httpd.conf file to change Allow Override None to Allow Override All, and restarted apache service before the installation.

 

After install, I can confirm the tables were added to the database, also some data. I have placed a simple test.html under the magento install directory and this file is accessible via the internet.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Struggling to install Magento CE 2.1.6 on CentOS

I have managed to resolve the issue.

 

The Apache service has a RLimitMEM, memory restriction control in place, which limited to 300MB. Once this is disabled and apache restated. Both the store home page and the admin page loads okay, although a bit slow.

View solution in original post

1 REPLY 1

Re: Struggling to install Magento CE 2.1.6 on CentOS

I have managed to resolve the issue.

 

The Apache service has a RLimitMEM, memory restriction control in place, which limited to 300MB. Once this is disabled and apache restated. Both the store home page and the admin page loads okay, although a bit slow.