Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:21:57+00:00 2026-06-01T14:21:57+00:00

My problem: require_once ‘/includes/aws-sdk-1.5.2/sdk.class.php’; My environment: I have a pretty standard PHP site that

  • 0

My problem:

require_once '/includes/aws-sdk-1.5.2/sdk.class.php';

My environment:
I have a pretty standard PHP site that uses __autoload() to grab any classes that I need. However, I now need to include the SDK to send files over to S3, but simply requiring that library seems to throw off the scope of the entire app so that any code that follows is broken.

Example:

// Save to S3
require_once '/var/www/html/system/aws-sdk-1.5.2/sdk.class.php';

$s3 = new AmazonS3();

if( ! $s3->if_bucket_exists(S3_BUCKET) )
    throw new Exception('S3 bucket does not exist.');


$response = $s3->create_object(S3_BUCKET, $temp_file['s_unique_name'], array(
    'fileUpload' => $_FILES['my_file']['tmp_name'],
    'acl'        => $s3::ACL_PUBLIC
));

// Save file
$photo = new vehicle_photo();
$photo->i_vehicle = $i_vehicle;
$photo->s_file    = $temp_file['s_url'];
$photo->s_label   = $_FILES['my_file']['name'];
$photo->save();

So, with the // Save to S3 snippet enabled, the following vehicle_photo class can no longer be found, in addition to all other classes that may be used after this point. If I disable it, everything works.

What’s happening here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:21:59+00:00Added an answer on June 1, 2026 at 2:21 pm

    Sounds like the autoloading mechanisms are conflicting. You might find this helpful: https://forums.aws.amazon.com/thread.jspa?threadID=85239 . Additionally, spl_autoload_register is better than plain old __autoload – consider migrating your autoloader code to that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You will have to get.class.php for giving help. Working case(index.php spaghetti): <?php require_once 'classes/get.class.php';
I have a problem with the following piece of PHP script: <?php abstract class
A have a problem with PHP application, that I'm working on. Main page which
I'm having a problem whereby vars that i have stated in an external php
I have a problem here that requires to design a data structure that takes
The code I currently have: <?php /** PHPExcel */ require_once '../Classes/PHPExcel.php'; /** PHPExcel_IOFactory */
I have an HTML form POSTing to the following index.php: <?php require_once(/home/full/path/to/included/file.php); ?> And
I have run into a very interesting problem trying to debug my custom PHP
I've a problem with PEAR (PHP). This is the error: Warning: require_once(DB.php): failed to
I have some PHP code which looks roughly like this require_once 'cache.php'; require_once 'generator.php';

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.