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

  • SEARCH
  • Home
  • 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 6695057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:10:33+00:00 2026-05-26T06:10:33+00:00

I’m trying to add a new folder to the application folder in zend framework,

  • 0

I’m trying to add a new folder to the application folder in zend framework, but none of the classes I create in the new folder can be found.

What I have is this structure:

application/
  models/
  modules/
  services/
    Test.php

I tried to call on the class Test.php:

class Service_Test{

}

$test = new Service_Test()

This results in the error:
PHP Warning: include_once(): Failed opening ‘Service/Test.php’ for inclusion (include_path=’…’) in library/Zend/Loader.php on line 146.

(The include_path contains a list of directories, which I removed for privacy).

I thought that Services would be automatically found in the same way that Models are automatically found. Does anyone know how I can make Zend framework find the Services folder?


I tried this as well:

require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
    $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
        'basePath'  => ROOT_PATH . '/application',
        'namespace' => 'Service',
    ));

PHP Fatal error: Class ‘Service_Test’ not found

  • 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-05-26T06:10:34+00:00Added an answer on May 26, 2026 at 6:10 am

    Thanks everyone for your help. I finally figured out what was going on. The site I am working on has an atypical setup. It’s not extending any Zend Framework bootstrap class, or calling Zend_Application. The way classes were being autoloaded is by using:

    set_include_path(ROOT_PATH . '/application/models'.PATH_SEPARATOR .
                 ROOT_PATH . '/library'.PATH_SEPARATOR .
             get_include_path());
    
    require_once('Zend/Loader.php');
    @Zend_Loader::registerAutoload();
    

    I changed it to:

    set_include_path(ROOT_PATH . '/application/models'.PATH_SEPARATOR .
                 ROOT_PATH . '/library'.PATH_SEPARATOR .
             get_include_path());
    
    require_once 'Zend/Loader/Autoloader.php';
    $autoloader = Zend_Loader_Autoloader::getInstance();
    $autoloader->setFallbackAutoloader(true);
    $resources = new Zend_Loader_Autoloader_Resource(array(
              'namespace' => '',
              'basePath'  => ROOT_PATH . '/application/',
          ));
    $resources->addResourceTypes(array(
              'service' => array(
                  'path'      => 'services',
                  'namespace' => 'Service',
              )));
    

    Technically, I did not have to add the resource, but if I didn’t, and just relied on putting /application/services into the include path, then I would not be able to prefix my classes with ‘Service_’.

    I’m not sure I would recommend this setup (no Bootstrap class extension or use of Zend_Application) for anyone else. It would be interesting to see what other people thought of this practice. Good or bad? In any case, that is how I solved the issue.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.