Search code examples
phpzend-frameworkzend-loader

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream


We have a gym display screen working on our server, and now the client is asking me to add another screen to it. I'm new to php and Zend, so any help is appreciated.

I'm trying to set up a sub domain (eg. gymtest.group.com) so I can work on it, it is exact the same code with the working one (gym.group.com), the following warning error comes up.

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /home/group/subdomains/gymtest/Lynfield/Screen_01/includes/configure.php on line 131

Can anyone give me some direction on this please? I can give you more info if needed. Thank you.

S:)

here is some code from configure.php

switch($_SERVER['SERVER_NAME'])
{
    case 'localhost':
        // SERVER PATHS
        define('DOC_ROOT_LYNFIELD_1', $_SERVER['DOCUMENT_ROOT'].'gymtest/lynfield/Screen_01/');
        define('BASE_HREF_LYNFIELD_1', 'http://'.$_SERVER['SERVER_NAME'].'/gymtest/lynfield/Screen_01/');
        break;
    default:
        // SERVER PATHS
        define('DOC_ROOT_LYNFIELD_1', $_SERVER['DOCUMENT_ROOT'].'/lynfield/Screen_01/');
        define('BASE_HREF_LYNFIELD_1', 'http://'.$_SERVER['SERVER_NAME'].'/lynfield/Screen_01/');
        break;
}


switch($_SERVER['SERVER_NAME'])
{
    case 'localhost':
        break;
    default:
        require_once('Zend/Loader.php');
        Zend_Loader::loadClass('Zend_Gdata');
        Zend_Loader::loadClass('Zend_Gdata_Calendar');
        break;
}   

Update- I've got the answer from a developer.

Just in case someone got into the same situation, the config was actually in the htaccess files, all the working screens has this line

php_value include_path "/home/group/subdomains/gym/screen3/ZendGdata/library"

except the not working screen, so I added the line above in htaccess with a different screen number, and it worked.

I'm still not so sure how the first working site works while the line is missing for lynfield, but the screen works perfectly fine for the original site, so it would be great if someone can explains it?? But for now here is the answer for my copied screen.

Thanks everyone. S:)


Solution

  • In htaccess file, php_value include_path "/home/group/subdomains/gym/screen3/ZendGdata/library" fixed the problem. Full details please see the update above. Thanks everyone.