简体   繁体   中英

getting AssetManager to work in zf2

I'm trying to get AssetManager to work in a plain new ZendSkeleton Application using this Blog and the wiki . I followed each step but can't get it to work, respectively tried every thing I could imagine... I'm using latest Zend2 Framework 2.2.6 and AssetManager dev-master via composer. My files are located in ./module/Application/public. The Module is registered in ./config/application.config.php an loaded (testet via ZendDeveloperTools).

My config file ./module/Application/config/module.config.php is shown here:

return array(
   'asset_manager' => array(
        'resolver_configs' => array(
            'paths' => array(
                'Application' => __DIR__ . '/../public',
            ),
        ),
    ),
...

I have tried using maps and collections, but there is no way to access my files in "./module/Application/public" folder via " http://localhost:8888/test.css ".

Anyone any idea how this problem could be solved? Many thanks in advance.

I now that post is old, but anyway maybe it helps someone, i got same problem, issue was in my apache server configuration. In my /etc/sites-available/*.conf file I changed AllowOverride None to All and everything works now. My example of conf:

 <VirtualHost zend.loc:80>
        ServerName zend.loc
        DocumentRoot /var/www/zend.loc/public
        <Directory /var/www/zend.loc/public>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory> 
</VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM