0

I've been attempting to set up Magento 2 on a WAMP server and have ran into a few errors. My Magento UI doesn't look right and I have 2 errors in the error log (When you F12 the page).

"Uncaught TypeError: require is not a function"

AND

"GET http://localhost/Magento2/pub/static/version1533909984/adminhtml/Magento/backend/en_US/requirejs-config.js 404 (Not Found)"

I have attempted to solve these errors by using several commands such as:

1.) php bin/magento dev:source-theme:deploy

2.) php bin/magento deploy:mode:set production

3.) php bin/magento setup:static-content:deploy

however they have had no affect at all. If i'm not mistaken, I believe the error lies with setting up static content but I am probably wrong. Every command and change I have made has had no luck.

Any help would be greatly appreciated. Thanks in advance :)

Some commands that i have tried

Image of what my UI looks like and the magento error log

enter image description here

  • So Delete in /pub/static except .htaccess and /var then run below commands php bin/magento setup:di:compile and php bin/magento setup:static-content:deploy – Learing_Coder Aug 10 '18 at 16:08
  • I get an 'out of memory error' (see image 3). I've changed all my memory values in php.ini as well. – Greg Aug 10 '18 at 16:28
  • run the below commands php -dmemorylimit=1G bin/magento setup:di:compile php -dmemorylimit=1G bin/magento setup:static-content:deploy – Learing_Coder Aug 10 '18 at 17:22
0

You can fix memory limit problem by editing app/bootstrap.php , just add following code at the start of the file ;

ini_set('memory_limit', -1);
0

Please run below command in Magento root directory

Below command for Magento files and directory permissions

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml;

Below command deploy static content, compile code, indexing content and clear cache

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush

Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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