I got 404 for /static/_requirejs/adminhtml/Magento/backend/en_US/requirejs-config.js
even after setup:static-content:deploy
as well as /static/adminhtml/Magento/backend/en_US/prototype.js and /static/adminhtml/Magento/backend/en_US/text.js
so Admin isn't working
@luckyraul are you in developer mode or production mode? Also are you on apache or nginx?
Default, nginx
Same exact issue.
AWS m4.large, Ubuntu 14.04, Nginx 1.9.x, HHVM 3.10.x, MySQL 5.6
$MAGE_MODE developer
Fresh install from Magento-2.0.0-xxxx.tar.gz downloaded from the magentocommerce.com website.
There are a few .js files that return a 404, and as a result make the backend unusable (links don't work and forms don't submit.)
More info:
Firefox tries to call the URL:
https://ex.com/static/_requirejs/adminhtml/Magento/backend/en_US/secure/requirejs-config.js
This get rewritten via nginx to:
https://ex.com/static.php?resource=_requirejs/adminhtml/Magento/backend/en_US/secure/requirejs-config.js
Which produces the following output:
File '/usr/share/nginx/magento2/' does not exists.
#0 /usr/share/nginx/magento2/vendor/magento/module-media-storage/Model/File/Storage/Response.php(59): Magento\Framework\File\Transfer\Adapter\Http->send()
#1 (): Magento\MediaStorage\Model\File\Storage\Response->sendResponse()
#2 /usr/share/nginx/magento2/vendor/magento/framework/Interception/Interceptor.php(144): call_user_func_array()
#3 /usr/share/nginx/magento2/var/generation/Magento/MediaStorage/Model/File/Storage/Response/Interceptor.php(26): Magento\MediaStorage\Model\File\Storage\Response\Interceptor->___callPlugins()
#4 /usr/share/nginx/magento2/vendor/magento/framework/App/Bootstrap.php(259): Magento\MediaStorage\Model\File\Storage\Response\Interceptor->sendResponse()
#5 /usr/share/nginx/magento2/pub/static.php(13): Magento\Framework\App\Bootstrap->run()
#6 {main}
Moreover in production mode after compile static assets the frontend doesn't load any of them.
Welp this is embarrassing. It seems like this is just a permission issue.
On my machine these missing files had permissions 0770, so my solution was to simply:
sudo chmod -R 775 /usr/share/nginx/magento2
These assets must be getting downloaded during the install process or something and not being set with the correct permissions, or written to disk by a different user process.
Don't really know. Any-hoo I realize that just setting my entire installation dir to 0775 is a terrible idea in terms of security, but I will fix it later when I have a better idea of what user/group/permissions magento needs.
I also have this problem. I'm in the process of getting all my permissions right, and this is not working.
Permissions on pub/static/_requirejs/adminhtml/Magento/backend/en_US/requirejs-config.js are 660, nginx user should be able to access it through the group.
But the browser says 404. How do I fix it?
Edit: Specifically, nginx logs say that it couldn't access pub/static/adminhtml/Magento/backend/en_US/mage/apply/scripts.js due to (13: Permission denied).
I managed to resolve the requirejs-config.js 404 by changing the ownership of the parent folder of my web root.
chown -R www-data:www-data web_root_parent
and then deleting pub/static, pub/media and flushing all cache in the magento admin
In my case, after 2 days of struggling, issue was resolved by changing server from nginx to apache.
Yup, I've given up.
Bummer you had to switch to apache (I prefer nginx) but glad it's working. If you're still interested post the nginx config. I struggled on that for a while and finally realized there were some subtle nuances hanging me up.
iirc, Magentos' installation wizard checks permissions, but is very rudimentary and doesn't check the webserver user (who would own the dynamically generated assets). I should contribute to that....
got also the 404 on prototype.js solved it by set 0777 permissions on pub folder
Most helpful comment
I managed to resolve the requirejs-config.js 404 by changing the ownership of the parent folder of my web root.
chown -R www-data:www-data web_root_parentand then deleting
pub/static,pub/mediaand flushing all cache in the magento admin