[英]AWS SDK PHP - Autoload - Linux
I created a Wordpress Plugin to be able to create an instance on AWS. 我创建了一个Wordpress插件,以便能够在AWS上创建实例。
After fixed my autoloader cause namespace, now it does work both on Linux and Win, but in Linux I still got this error: Fatal error: Class 'Aws\\EC2\\Ec2Client' not found in blablabla 修复了我的自动加载器引起的名称空间之后,现在它在Linux和Win上都可以使用,但是在Linux中我仍然遇到此错误: 致命错误:在blablabla中找不到类'Aws \\ EC2 \\ Ec2Client'
File structure: 文件结构:
root
vendor
|-->aws
|-->composer
|-->twig
|-->...
|-->autoload.php
index.php
In index.php: 在index.php中:
require plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';
Why I have this problem on Linux? 为什么在Linux上有此问题?
Thanks 谢谢
Microsoft operating systems (DOS and Windows) use backslashes "\\", UNIX-based operating systems (Linux) use slashes "/". Microsoft操作系统(DOS和Windows)使用反斜杠“ \\”,基于UNIX的操作系统(Linux)使用反斜杠“ /”。
Use PHP's helper: DIRECTORY_SEPARATOR
to automatically detect the backslashes/slashes. 使用PHP的帮助程序:
DIRECTORY_SEPARATOR
自动检测反斜杠/斜杠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.