[英]Autoloading not working on Amazon Linux (EC2)
I am using an autoloader
to automatically include all my plugin classes in WordPress. 我正在使用
autoloader
自动将我的所有插件类包括在WordPress中。 This works fine locally. 这在本地工作正常。 However, if I put the same code on Amazon EC2 instance, it fails to find the classes.
但是,如果将相同的代码放在Amazon EC2实例上,它将无法找到类。 The file paths are correct, I compared the ones on my local installation to the ones on the EC2 instance.
文件路径正确,我将本地安装中的文件路径与EC2实例上的文件路径进行了比较。
Here is the original code in question: https://wordpress.stackexchange.com/questions/193997/namespaces-in-wordpress-how-do-i-initiate-the-main-class 这是有问题的原始代码: https : //wordpress.stackexchange.com/questions/193997/namespaces-in-wordpress-how-do-i-initiate-the-main-class
I have found that same problem, however in my case culprit was the git. 我发现了同样的问题,但是在我看来,罪魁祸首是git。 Earlier I have created the folder Abc on my development machine and pushed it.
之前,我在开发计算机上创建了文件夹Abc并将其推送。 Later I renamed the folder to abc but it was not effectively pushed into the git.
后来我将文件夹重命名为abc,但没有有效地将其推入git。 I have resolved the problem using following git commands:
我已经使用以下git命令解决了这个问题:
git reset HEAD git mv Abc tmp git mv tmp abc git commit -am 'Case sensitive folder rename fix' git push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.