SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zend Framework tut problem..

    I am having trouble loading the Zend class.. i am using the tutorial here:
    http://akrabat.com/zend-framework-tutorial/

    The index looks like this:

    PHP Code:
    <?php
    error_reporting
    (E_ALL|E_STRICT);
    date_default_timezone_set('Europe/London');
    set_include_path('.' PATH_SEPARATOR './library'
          
    PATH_SEPARATOR './application/models/'
          
    PATH_SEPARATOR get_include_path());
    include 
    "Zend/Loader.php";
    Zend_Loader::loadClass('Zend_Controller_Front');
    // setup controller
    $frontController Zend_Controller_Front::getInstance();
    $frontController->throwExceptions(true);
    $frontController->setControllerDirectory('./application/controllers');
    // run!
    $frontController->dispatch();
    But i always get the error:

    Warning: include(Zend/Loader.php) [function.include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/zf-tutorial/index.php on line 7

    Warning: include() [function.include]: Failed opening 'Zend/Loader.php' for inclusion (include_path='.:./library:./application/models/:.:/opt/lampp/lib/php') in /opt/lampp/htdocs/zf-tutorial/index.php on line 7

    Fatal error: Class 'Zend_Loader' not found in /opt/lampp/htdocs/zf-tutorial/index.php on line 8

    Even when i set the include path to absolute..??

    When i change :

    PHP Code:
    include "Zend/Loader.php"
    To
    PHP Code:
    include "library/Zend/Loader.php"
    It does seem to find the file but i get a permission error?

    Warning: include(library/Zend/Loader.php) [function.include]: failed to open stream: Permission denied in /opt/lampp/htdocs/zf-tutorial/index.php on line 7

    Warning: include() [function.include]: Failed opening 'library/Zend/Loader.php' for inclusion (include_path='.:./library:./application/models/:.:/opt/lampp/lib/php') in /opt/lampp/htdocs/zf-tutorial/index.php on line 7

    Fatal error: Class 'Zend_Loader' not found in /opt/lampp/htdocs/zf-tutorial/index.php on line 8
    Anybody knows what else to try?
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  2. #2
    SitePoint Addict
    Join Date
    Jul 2006
    Location
    Kansas City, MO
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where is Zend/Loader.php located on your system? Have you thought that if you told it to include the actual location of the file that it might just work?

    Absolute paths begin with the root level, such as /home/username/www/file.php or c:/apache/htdocs/file.php

  3. #3
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yeah forgot i also tried putting the include path in the .htaccess didn't work either it does not find the file again

    PHP Code:
    RewriteEngine on
    RewriteRule 
    .* index.php
    php_flag magic_quotes_gpc off
    php_flag register_globals off

    php_value include_path 
    .:/opt/lampp/htdocs/zf-tutorial/library 
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  4. #4
    SitePoint Addict
    Join Date
    Jul 2006
    Location
    Kansas City, MO
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apache doesnt have rights to read the Zend files. chmod 777 *.php in the Zend directory

  5. #5
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ZareMedia View Post
    Apache doesnt have rights to read the Zend files. chmod 777 *.php in the Zend directory
    Hmm even when i put all dirs and files on read / write / delete it still does not work.. also does should not be necesaary all other php apps work fine without chmodiing them to 777.
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  6. #6
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Pixelsoul, I was just wondering if you ever got this problem sorted


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •