0
votes

I am installing zend framework 2 on my shared hosting server. So far I did the steps below.

  1. downloaded the ZF2 skeleton application and uploaded to my public_html. I have config, data, module, public, vendor, and init_autoloader.php in "public_html" folder on my server at this moment.

  2. downloaded the full package (ZendFramework-1.12.9) and copied "library" folder and placed it under public_html/vender/ZF2/ so that it would work in init_autoloader.php

  3. created .htaccess in which I entered below:

    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !.(js|ico|txt|gif|jpg|png|css)$ index.php

  4. created index.php and placed it under public_html/. The content is below:

    <?php 
    define('RUNNING_FROM_ROOT', true);
    include 'public/index.php';
    ?>
    
  5. I opened a browser and ran the url (pbm.pbmarketing.ca).

I have got a fatal error message below:

Fatal error: Class 'Zend\Loader\AutoloaderFactory' not found in /home/pbmarket/public_html/pbm/init_autoloader.php on line 44

What step did I do wrong? Could you please help me with this issue?

1
2. downloaded the full package (ZendFramework-1.12.9) - this is ZF1 not ZF2!? public_html/vender/ZF2/ Shouldn't it be vendor?Zdenek Machek

1 Answers

2
votes

Once you have the skeleton app, use Composer to install ZF2 (see the instructions here: http://framework.zend.com/manual/2.3/en/ref/installation.html). Since you're on shared hosting you may need to do this before uploading the files. You don't need to do download ZF itself (and not ZF1!)

I've not used ZF2 on shared hosting, so can't help you with that side of it, but the error you're currently getting is because you don't have any of the ZF2 files.