doushan1850 2011-01-28 10:42
浏览 40

使用XAMPP和PEAR进行设置后找不到AWS SDK

I'm trying to set up the AWS SDK for PHP on an EC2 instance, but I am having trouble getting the SDK to work. Just to note, I'm new to all AWS services, and I've only written PHP scripts, I've never configured it before. When I run the following script, I get "Fatal error: Class 'AmazonEC2' not found in /opt/lampp/htdocs/index.php on line 6":

require_once 'sdk.class.php';
$ec2 = new AmazonEC2(); //Line 6

As far as I can tell, the AmazonEC2 class is in:

/opt/lampp/lib/php/AWSSDKforPHP/services/ec2.class.php

I followed this setup guide: http://aws.amazon.com/articles/PHP/4261

Here are some details:

  • EC2 Instance: t1.Micro node of Basic 32-bit Amazon Linux AMI 2010.11.1 Beta (AMI Id: ami-76f0061f)
  • PHP is set up using XAMPP. Basically untar into /opt/lampp, where it is self contained.
  • SDK installed using PEAR. Done with:
    • sudo /opt/lampp/bin/pear channel-discover pear.amazonwebservices.com
    • sudo /opt/lampp/bin/pear install aws/sdk

My path was set to ".:/opt/lampp/lib/php" by default. I tried adding ".:/opt/lampp/lib/php/AWSSDKforPHP" but that didn't work. I tried changing file permissions, but no dice.

I've never used PEAR before, or XAMPP. Any ideas for how I can get the SDK working with PHP? I'm thinking it has to be just an include_path issue, but I'm not sure what to set it to work. (I reset apache after I change php.ini so that isn't the issue either).

Here are some paths on my system:

/opt/lampp/lib/php/AWSSDKforPHP
/opt/lampp/etc/php.ini
/opt/lampp/htdocs/index.php
/home/ec2-user/.aws/sdk/config.inc.php
  • 写回答

5条回答 默认 最新

  • dqmnueuu459279 2011-01-31 05:32
    关注

    Have you updated your PHP's include_path in php.ini?

    Edit: On second look, it appears you did. Have you tried including the services/ec2.class.php file in the script you're trying to run?

    评论

报告相同问题?

悬赏问题

  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接