apacheÔõôÉèÖÃzend
ÔõÑùÔÚ apache ÖÐÉèÖà zend£¿ÔÚ apache web ЧÀÍÆ÷ÖÐÉèÖà zend framework µÄ°ì·¨ÈçÏ£º×°Öà zend framework ²¢½âѹµ½ web ЧÀÍÆ÷Ŀ¼ÖС£½¨Éè .htaccess Îļþ¡£½¨Éè zend Ó¦ÓóÌÐòĿ¼²¢Ìí¼Ó index.php Îļþ¡£ÉèÖà zend Ó¦ÓóÌÐò£¨application.ini£©¡£ÖØÐÂÆô¶¯ apache web ЧÀÍÆ÷¡£
ÔõÑùÔÚ Apache ÖÐÉèÖÃ Zend
¼ò½é
Zend Framework ÊÇÒ»ÖÖÓÃÓÚ¿ª·¢ PHP Web Ó¦ÓóÌÐòµÄÊ¢Ðпò¼Ü¡£ÒªÔÚ Apache Web ЧÀÍÆ÷ÖÐÉèÖà Zend£¬ÐèÒªÖ´ÐÐÒÔÏ°취£º
1. ×°ÖÃ Zend Framework
ÏÂÔØ Zend Framework µÄ×îа汾¡£
½« Zend Framework Ŀ¼½âѹµ½ Web ЧÀÍÆ÷µÄ¿É»á¼ûλÖã¬ÀýÈç /var/www/zendframework¡£
2. ½¨Éè .htaccess Îļþ
ÔÚ Web ЧÀÍÆ÷µÄ¸ùĿ¼Öн¨Éè .htaccess Îļþ¡£
Ìí¼ÓÒÔÏÂÄÚÈÝ£º
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php [L]
µÇ¼ºó¸´ÖÆ
3. ½¨Éè Zend Ó¦ÓÃ
ÔÚ Web ЧÀÍÆ÷µÄ¿É»á¼ûλÖý¨Éè Zend Ó¦ÓóÌÐòĿ¼£¨ÀýÈ磬/var/www/my_app£©¡£
½¨ÉèÒ»¸ö index.php Îļþ£¬×÷ΪӦÓóÌÐòµÄÈë¿Úµã¡£
½«ÒÔÏ´úÂëÌí¼Óµ½ index.php Îļþ£º
<?php require_once '/var/www/zendframework/Zend/Application.php'; $application = new Zend_Application( 'production', '/var/www/my_app/application/configs/application.ini' ); $application->bootstrap() ->run(); ?>
µÇ¼ºó¸´ÖÆ
4. ÉèÖÃ Zend Ó¦ÓÃ
ÔÚ Zend Ó¦ÓÃĿ¼Öн¨Éè application Ŀ¼¡£
ÔÚ application Ŀ¼Öн¨ÉèÒ»¸ö configs Ŀ¼¡£
ÔÚ configs Ŀ¼Öн¨ÉèÒ»¸ö application.ini Îļþ£¬²¢ÉèÖÃÒÔÏÂÉèÖãº
[production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = "/var/www/zendframework/library"
µÇ¼ºó¸´ÖÆ
5. ÖØÐÂÆô¶¯ Apache Web ЧÀÍÆ÷
ÖØÆô Apache Web ЧÀÍÆ÷£¬Ê¹¸ü¸ÄÉúЧ¡£
ÏÖÔÚ£¬Zend Framework ÒÑÔÚ Apache Web ЧÀÍÆ÷ÖÐÉèÖÃÍê³É¡£Äú¿ÉÒÔͨ¹ý»á¼û http://your-server-address/ »á¼û Zend Ó¦ÓóÌÐò¡£
ÒÔÉϾÍÊÇapacheÔõôÉèÖÃzendµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡