apache 新建虚拟机 +Zend Framework建立

官方下载 Zend Framework

1、LoadModule rewrite_module modules/mod_rewrite.so

2、建立映射主机 c:\windows\system32\drivers\etc\hosts  加入 127.0.0.1 sugou

3、建立虚拟主机

Listen 8080 #监听端口
       <VirtualHost *:8080>
            ServerAdmin admin@sugou.local                           
            ServerName sugou      #域名 输入"http://sugou:8080/即可到达该目录
            DocumentRoot "e:/php/sugou/htdocs"   
            <Directory "e:/php/sugou/htdocs">
                 Options All
                 AllowOverride All

                 </Directory>
 php_value include_path ",;e:/php/sugou/include;e:/webservices/phpinstall/PEAR"
 php_value magic_quotes_gpc off
 php_value register_globals off
 php_value display_errors on
        </VirtualHost>    

4、建立. .htaccess 文件

cmd->cd 到index.php目录 键入命令 edit .htaccess 输入
           文件内容为
           RewriteEngine on
           RewriteRule !\.(js|ico|gif|bmp|jpg|png|css|xml|html|txt)$ index.php [NC]

 

5、加载Zend Framework

      index.php

<?php

      require_once("Zend/Loader.php"); //这里自动获取路径 总路径为 index_path+"Zend/Loader.php"

      Zend_Loader::loadClass('Zend_Controller_Front');  
      Zend_Loader::loadClass('Zend_Config_Ini');  
      Zend_Loader::loadClass('Zend_Registry');  
      Zend_Loader::loadClass("Zend_View");  
      Zend_Loader::loadClass('Zend_Db');
      echo "good information";

?>

posted @ 2009-07-08 02:55  系咪噶  阅读(522)  评论(0编辑  收藏  举报