Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am hoping that someone on here can help. I am attempting to install and run Magento 2 on WAMP on a Windows 7 machine with little success.

After jumping through the many and various hoops to get the site to load I am now faced with 404 responses and no styles or javascript loading.

Spec is as follows:

  • Magento-CE-2.0.0+Samples
  • Apache 2.4.9
  • PHP 5.5.12
  • MySQL 5.6.17

When I look at the browser console among the errors are attempts to access files that are not in the pub/static folder. The "frontend" folder does get loaded and most of the files are present. I have noticed however that some CSS files are not present.

On running the PHP deploy command

php bin/magento setup:static-content:deploy

that is mentioned in other posts I get the below error. I am not sure how to remedy this?

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in C:\wamp\www\magento\vendor\oyejorge\less.php\lib\Less\Visitor.php on line 45

Any assistance will be greatly appreciated.

UPDATE

I bumped up the PHP memory allowance and ran the php deploy script again. This time it did not error and executed fully. However the same issue as described above is still present. The site loads but every attempt to load any page or asset results in a 404 page not found error with no styling applied.

Please see below the errors in Chrome Inspector

enter image description here

share|improve this question
1  
    
@TejabhagavanKollepara This question was asked first, is well formed, has good answers, so IMO the other question is a dupe candidate, not this one... B.t.w., if the flag on the other question as a duplicate to this one was turned down, it is not necessary to flag this question as duplicate of the other to try to achieve the same. – 7ochem Oct 7 at 9:02
up vote 17 down vote accepted

SOLUTION # 1 (IF YOU WANT TO EDIT XML FILE)

I would like you to download Magento 2 zip from magentocommerce.com/download with sample data, create new db in phpmyadmin, extract zip in htdocs folder. Install Magento 2 but do not use localhost use 127.0.0.1 in store URL and admin URL. After successful installation DO NOT run magento.

Now we are going to clear / delete caches and sessions of Magento 2. Go to following paths and delete everything:

ROOT > var > cache > *DELETE ALL*
ROOT > var > page_cache > *DELETE ALL*
ROOT > var > session > *DELETE ALL*

When Magento 2 is not in production mode, it will try to create symlinks for some static resources on local server. We have to change that behavior of Magento 2 by going to edit ROOT > app > etc > di.xml file. Open up di.xml in your favorite code editor, find the virtualType name="developerMaterialization" section. In that section below, you will find an item <item name="view_preprocessed" xsi:type="object"> which needs to be modified. You can modify it by changing the following content:

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

To:

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Now last step, also delete old files generated in ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

SOLUTION # 2

Install Composer. Now I would like you to download Magento 2 zip from magentocommerce.com/download, create new db in phpmyadmin, extract zip in htdocs folder. Install Magento 2 but do not use localhost use 127.0.0.1 in store URL and admin URL. After successful installation DO NOT run magento.

Now we are going to verify Composer installation, Deploy static content, clear / flush Magento cache and reindex the Magento 2 blocks. To perform all above actions, press WINDOWS KEY + R to open RUN dialog and type “cmd” to open Command Prompt.

Type “cd PATH_TO_YOUR_MAGENTO2_FILES” to enter in Magento 2 ROOT directory.

Now to verify Composer installation in above directory, type “composer install”.

If you get any error in this step, please check your Composer installation

In this step, we are setting up static content to deploy on our Magento store. To perform this, type “php bin/magento setup:static-content:deploy”.

If you get any error, check your PHP.EXE and PHP.INI Environment Variable

Clear / Flush Magento cache by typing “php bin/magento cache:flush” in CMD.

And finally, to Reindex Magento Static Blocks type “php bin/magento indexer:reindex”.

You are done with successful installation of Magento 2.

share|improve this answer
    
Also in php.ini change max_execution_time to 500, memory_limit to 2048M, post_max_size to 2048M, upload_max_filesize to 2048M and max_file_uploads to 2048. – Fayyaz Khattak Jan 14 at 14:04
    
Thank you for your quick response. I have made these changes but they have had no effect. I restarted WAMP server after making the changes. I have edited the question to show the errors that I can see in the Chrome inspector – E.Gain Jan 14 at 14:32
    
Oh i am sorry to mention one more thing, first delete all cache and session, make changes in di.xml and also delete everything from ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS – Fayyaz Khattak Jan 14 at 14:35
    
@E.Gain see edited answer – Fayyaz Khattak Jan 14 at 14:38
    
Hi, I have done this and still no change – E.Gain Jan 14 at 14:44

If you are facing problem of css and js page load design after installation in magento2

please follow the following step-:

open the terminal and navigate to magento web root

 $ cd /var/www/html/magento2 

Step 1.

 $ php bin/magento setup:static-content:deploy

Step 2.

$ php bin/magento indexer:reindex

Step 3.

make sure apache “rewrite_module” is enable and then restart the server

Step 4.

$ chown -R www-data:www-data /var/www/html/magento2 

Step 5.

 $ chmod -R 777 /var/www/html/magento2 

Step 6.

delete cache folder under var/cache

The above step working. I hope this will work for you also.

Let me know if any issue. :)

http://gotechnies.com/css-javascript-files-loading-magento-2-installation/

share|improve this answer
    
this works for me, thanks – hkguile Jul 27 at 7:58
    
how run these commands in windows ? – Hassan ALi Aug 5 at 16:44
    
"Let me know if any issue" - doesn't work on Windows. – Carl Whalley Oct 4 at 12:55

1- Try to disable cache if you not disable it before
2- Make sure you have latest version of magento with clean code. If you modify or customize something make sure fix all errors
3- run severals command below may help you

php bin/magento indexer:reindex
php bin/magento cache:flush
remove folders in
pub/static
var/cache
var/view_preprocessed/css/frontend/ and ..source/frontend
php bin/magento setup:static-content:deploy // make sure it complete without problems

share|improve this answer

I solved it by following these steps by BlueOrchidd:

https://community.magento.com/t5/Installing-Magento-2/Magento-2-Installation-Worst-Experience-Ever/m-p/23786#M382

One important thing: Dont change Locale to anything that en_US. after installation deal with that ..

share|improve this answer

Solved !!!

Just access your root folder in cmd panel then run following commands:

(1) php bin/magento setup:static-content:deploy

(2) php bin/magento indexer:reindex

After that go to root -> var folder delete cache and page_cache folder.

Then just refresh your homepage and admin panel. Its Working !!!!! Cool !!!!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.