- quickstart
- |-- application
- | |-- Bootstrap.php
- | |-- configs
- | | `-- application.ini
- | |-- controllers
- | | |-- ErrorController.php
- | | `-- IndexController.php
- | |-- models
- | `-- views
- | |-- helpers
- | `-- scripts
- | |-- error
- | | `-- error.phtml
- | `-- index
- | `-- index.phtml
- |-- library
- |-- public
- | |-- .htaccess
- | `-- index.php
- `-- tests
- |-- application
- | `-- bootstrap.php
- |-- library
- | `-- bootstrap.php
- `-- phpunit.xml
Programmer's Reference Guide
| Zend Framework & MVC Introduction |
プロジェクトを作成
プロジェクトを作成するには、まず、Zend Frameworkをダウンロードして、解凍しなければいけません。
Zend Framework をインストール
全部揃った PHP スタックと一緒に Zend Framework を手に入れる最も簡単な方法は、» Zend Server をインストールすることです。Zend Server には、 多くの Linux ディストリビューションと互換性のある一般的なインストール・パッケージだけでなく、 Mac OSX、Windows、Fedora Core および Ubuntu 用のネイティブのインストーラーがあります。
Zend Server をインストールし終わると、Mac OSX および Linux の場合は /usr/local/zend/share/ZendFramework 配下に、 Windows の場合は C:\Program Files\Zend\ZendServer\share\ZendFramework 配下にフレームワークのファイルが見つかるでしょう。 include_pathは、Zend Frameworkを含むように構成済みです。
あるいは、» Zend Framework の最新版 をダウンロードして内容を解凍することができます。 make a note of where you have done so.
php.ini の include_path 設定に アーカイブのlibrary/サブディレクトリへのパスを任意に追加できます。
これで終わりです。これで Zend Framework がインストールされ、使えるようになりました。
プロジェクトを作成
注意: zf コマンドラインツール
Zend Framework インストール先には bin/ サブディレクトリがあり、 UNIX ベースおよび Windows ベースのユーザーのために、それぞれスクリプト zf.sh および zf.bat を含みます。 このスクリプトに絶対パスを書きとめてください。
zf コマンドとの関係がわかっている場所ではどこでも スクリプトへの絶対パスに置き換えてください。Unix のようなシステムでは、シェルのエイリアス機能を使いたいかもしれません。 alias zf.sh=path/to/ZendFramework/bin/zf.sh
zf コマンドラインツール設定中に問題があった場合は、 マニュアル を参照してください。
ターミナルを開きます。(Windows ではスタート -> ファイル名を指定して実行 、それから cmd を使用します) プロジェクトを開始したいディレクトリに進みます。それから、適切なスクリプトへのパスを使用して、下記のいずれかを実行します。
- % zf create project quickstart
このコマンドを実行すると、基本的なサイト構造が作成されます。そこには基になるコントローラやビューが含まれます。 ツリーは下記のように見えます。
もしこの時点で Zend Framework を include_path に追加していないなら、library/ ディレクトリにコピーするか、または symlink することを勧めます。 いずれにせよ、Zend Framework インストール先の library/Zend/ ディレクトリをプロジェクトの library/ ディレクトリに再帰的にコピーするか、 または symlink することが必要になるでしょう。Unix のようなシステムでは、それは下記のいずれかのように見えます。
- # Symlink:
- % cd library; ln -s path/to/ZendFramework/library/Zend .
- # Copy:
- % cd library; cp -r path/to/ZendFramework/library/Zend .
Windows システムでは、これをエクスプローラから行なうのが最も簡単かもしれません。
Now that the project is created, the main artifacts to begin understanding are the bootstrap, configuration, action controllers, and views.
The Bootstrap
Your Bootstrap class defines what resources and components to initialize. By default, Zend Framework's Front Controller is initialized, and it uses the application/controllers/ as the default directory in which to look for action controllers (more on that later). そのクラスは下記のように見えます。
- // application/Bootstrap.php
- class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
- {
- }
As you can see, not much is necessary to begin with.
Configuration
While Zend Framework is itself configurationless, you often need to configure your application. The default configuration is placed in application/configs/application.ini, and contains some basic directives for setting your PHP environment (for instance, turning error reporting on and off), indicating the path to your bootstrap class (as well as its class name), and the path to your action controllers. それは下記のようになります。
- ; application/configs/application.ini
- [production]
- phpSettings.display_startup_errors = 0
- phpSettings.display_errors = 0
- includePaths.library = APPLICATION_PATH "/../library"
- bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
- bootstrap.class = "Bootstrap"
- appnamespace = "Application"
- resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
- resources.frontController.params.displayExceptions = 0
- [staging : production]
- [testing : production]
- phpSettings.display_startup_errors = 1
- phpSettings.display_errors = 1
- [development : production]
- phpSettings.display_startup_errors = 1
- phpSettings.display_errors = 1
Several things about this file should be noted. First, when using INI-style configuration, you can reference constants directly and expand them; APPLICATION_PATH is actually a constant. Additionally note that there are several sections defined: production, staging, testing, and development. The latter three inherit settings from the "production" environment. This is a useful way to organize configuration to ensure that appropriate settings are available in each stage of application development.
Action Controllers
Your application's action controllers contain your application workflow, and do the work of mapping your requests to the appropriate models and views.
An action controller should have one or more methods ending in "Action"; these methods may then be requested via the web. By default, Zend Framework URLs follow the schema /controller/action, where "controller" maps to the action controller name (minus the "Controller" suffix) and "action" maps to an action method (minus the "Action" suffix).
Typically, you always need an IndexController, which is a fallback controller and which also serves the home page of the site, and an ErrorController, which is used to indicate things such as HTTP 404 errors (controller or action not found) and HTTP 500 errors (application errors).
デフォルトの IndexController は下記の通りです。
- // application/controllers/IndexController.php
- class IndexController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- // action body
- }
- }
そして、デフォルトの ErrorController は下記の通りです。
- // application/controllers/ErrorController.php
- class ErrorController extends Zend_Controller_Action
- {
- public function errorAction()
- {
- $errors = $this->_getParam('error_handler');
- switch ($errors->type) {
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
- // 404 error -- controller or action not found
- $this->getResponse()->setHttpResponseCode(404);
- $this->view->message = 'Page not found';
- break;
- default:
- // application error
- $this->getResponse()->setHttpResponseCode(500);
- $this->view->message = 'Application error';
- break;
- }
- $this->view->exception = $errors->exception;
- $this->view->request = $errors->request;
- }
- }
You'll note that (1) the IndexController contains no real code, and (2) the ErrorController makes reference to a "view" property. That leads nicely into our next subject.
Views
Views in Zend Framework are written in plain old PHP. View scripts are placed in application/views/scripts/, where they are further categorized using the controller names. In our case, we have an IndexController and an ErrorController, and thus we have corresponding index/ and error/ subdirectories within our view scripts directory. Within these subdirectories, you will then find and create view scripts that correspond to each controller action exposed; in the default case, we thus have the view scripts index/index.phtml and error/error.phtml.
View scripts may contain any markup you want, and use the <?php opening tag and ?> closing tag to insert PHP directives.
The following is what we install by default for the index/index.phtml view script:
- <!-- application/views/scripts/index/index.phtml -->
- <style>
- a:link,
- a:visited
- {
- color: #0398CA;
- }
- span#zf-name
- {
- color: #91BE3F;
- }
- div#welcome
- {
- color: #FFFFFF;
- background-image: url(http://framework.zend.com/images/bkg_header.jpg);
- width: 600px;
- height: 400px;
- border: 2px solid #444444;
- overflow: hidden;
- text-align: center;
- }
- div#more-information
- {
- background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
- height: 100%;
- }
- </style>
- <div id="welcome">
- <h1>Welcome to the <span id="zf-name">Zend Framework!</span><h1 />
- <h3>This is your project's main page<h3 />
- <div id="more-information">
- <p>
- <img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" />
- </p>
- <p>
- Helpful Links: <br />
- <a href="http://framework.zend.com/">Zend Framework Website</a> |
- <a href="http://framework.zend.com/manual/en/">Zend Framework
- Manual</a>
- </p>
- </div>
- </div>
The error/error.phtml view script is slightly more interesting as it uses some PHP conditionals:
- <!-- application/views/scripts/error/error.phtml -->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN";
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Zend Framework Default Application</title>
- </head>
- <body>
- <h1>An error occurred</h1>
- <?php if ('development' == $this->env): ?>
- <h3>Exception information:</h3>
- <p>
- </p>
- <h3>Stack trace:</h3>
- </pre>
- <h3>Request Parameters:</h3>
- </pre>
- <?php endif ?>
- </body>
- </html>
バーチャル・ホストを作成
このクイックスタートの必要上、» Apache Web サーバー を使用すると仮定しています。Zend Framework は、他の Web サーバーでも申し分なく動作します。 それには、Microsoft Internet Information Server、lighttpd、nginx などを含みます。 しかし、大抵の開発者は少なくとも Apache をよく知っていなければなりません。 そして、それはZend Framework のディレクトリ構造とリライト能力への簡単な導入を提示します。
vhost を作成するには、httpd.conf ファイルの位置を知る必要があります。 その場所には他の構成ファイルが格納されている可能性があります。いくつかの一般的な場所はこうです。
-
/etc/httpd/httpd.conf (Fedora や RHEL など)
-
/etc/apache2/httpd.conf (Debian や Ubuntu など)
-
/usr/local/zend/etc/httpd.conf (Linux 版 Zend Server)
-
C:\Program Files\Zend\Apache2\conf (Windows 版 Zend Server)
httpd.conf (一部のシステムでは httpd-vhosts.conf) 内で行なうべきことが2つあります。 1つ目は、NameVirtualHost が定義されていることを確実にすることです。 一般的にはそれを "*:80" という値に設定します。 2つ目は、バーチャル・ホストを定義することです。
- <VirtualHost *:80>
- ServerName quickstart.local
- DocumentRoot /path/to/quickstart/public
- SetEnv APPLICATION_ENV "development"
- <Directory /path/to/quickstart/public>
- DirectoryIndex index.php
- AllowOverride All
- Order allow,deny
- Allow from all
- </Directory>
- </VirtualHost>
There are several things to note. First, note that the DocumentRoot setting specifies the public subdirectory of our project; this means that only files under that directory can ever be served directly by the server. Second, note the AllowOverride, Order, and Allow directives; these are to allow us to use htacess files within our project. During development, this is a good practice, as it prevents the need to constantly restart the web server as you make changes to your site directives; however, in production, you should likely push the content of your htaccess file into your server configuration and disable this. Third, note the SetEnv directive. What we are doing here is setting an environment variable for your virtual host; this variable will be picked up in the index.php and used to set the APPLICATION_ENV constant for our Zend Framework application. In production, you can omit this directive (in which case it will default to the value "production") or set it explicitly to "production".
Finally, you will need to add an entry in your hosts file corresponding to the value you place in your ServerName directive. On *nix-like systems, this is usually /etc/hosts; on Windows, you'll typically find it in C:\WINDOWS\system32\drivers\etc. Regardless of the system, the entry will look like the following:
- 127.0.0.1 quickstart.local
Start your webserver (or restart it), and you should be ready to go.
Checkpoint
At this point, you should be able to fire up your initial Zend Framework application. Point your browser to the server name you configured in the previous section; you should be able to see a welcome page at this point.
| Zend Framework & MVC Introduction |
Add A Comment
Please do not report issues via comments; use the ZF Issue Tracker.
If you have a JIRA/Crowd account, we suggest you login first before commenting.

Comments
- change directory to your quickstart project folder ("cd <foldername>")
- delete the empty library folder that the zf installer created ("rm library")
- link the library folder from your ZF installation point ("mklink /D library '<ZF install path>/share/ZendFramework/library'")
If you're using earlier versions of Windows you could use the junction command, but it's a bit risky, so maybe better off copying the library folder contents?
It a BUG :-)))
It a BUG :-)))
It a BUG :-)))
It a BUG :-)))
It a BUG :-)))
zf show version return me that I have the latest version of zend framework
root@web-server:/var/www# zf show version
Zend Framework Version: 1.10.1
When I run which zf it returns me
root@web-server:/var/www# which zf
/usr/bin/zf
On zf show config:
User Configuration: /root/.zf.ini
`-- php
`-- includepath: .:/usr/share/php:/usr/share/pear
The problem appear when i'm trying to setup a new zend framework project bu running "zf create project <name_project>", it returns me the following:
root@web-server:/var/www# zf create project test
An Error Has Occurred
Provider 'project' is not a valid provider.
I have run this commant as simple user, and as root, same problem appear each time. It works on previous versin of Zend framework. It has been removed, it's a bug or I did something wrong?
to start using apache vhosts config the following line should be uncommented in httpd.conf:
Include conf/extra/httpd-vhosts.conf
and <VirtualHost> info added to conf/extra/httpd-vhosts.conf file
An error occurred
Page not found
Exception information:
Message: Invalid controller specified (quickstart)
Stack trace:
#0 D:\wamp\www\quickstart\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 D:\wamp\www\quickstart\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 D:\wamp\www\quickstart\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 D:\wamp\www\quickstart\public\index.php(26): Zend_Application->run()
#4 {main} Request Parameters:
array (
'controller' => 'quickstart',
'action' => 'index',
'module' => 'default',
)
any suggestion for this error?
Turned out there was a (default?) zf.bat in my xamp/php folder and xamp/php was in my path before my zend/bin folder.
If you don't need the space, unpack the whole framework under a folder and add that folder/bin to you path. You do not have to reboot but you do need to restart (close and reopen) your command prompt.
Good luck!
Turned out there was a (default?) zf.bat in my xamp/php folder and xamp/php was in my path before my zend/bin folder.
If you don't need the space, unpack the whole framework under a folder and add that folder/bin to you path. You do not have to reboot but you do need to restart (close and reopen) your command prompt.
Good luck!
cd /etc/apache2/mods-enabled/
sudo ln -s /etc/apache2/mods-available/rewrite.load ./rewrite.load
sudo /etc/init.d/apache2 reload
<h1>Welcome to the <span id="zf-name">Zend Framework!</span><h1 />
<h3>This is your project's main page<h3 />
'<h1 />' and '<h3 />' should be '</h1>' and '</h3>'?
Thanks,
afh
"This application failed to start because sqlite3.dll was not found. Re-installing the application may fix this problem." Go to this url, http://www.lizjamieson.co.uk/2008/06/03/sqlite3dll-was-not-found/
Its an artical on how to fix the problem.
-Alain
1. i inserted the path of /var/ZendFramework/library/ in to include_path of php.ini which is located at /etc/php5/apache2/php.ini at my system.
2. i also created the symink of /library directory of ZendFrameWork in the /var/www/quickstart/library/ .
3. i also insterted the line 127.0.0.1 quickstart.local in /etc/hosts file. where in /etc/hosts file two line are already inserted. after insterting the above line my file became :
127.0.0.1 localhost
127.0.1.1 backtrack bt
127.0.0.1 quickstart.local
4. In my system /etc/apache2/httpd.conf file is empty. so i inserted the virtual host code in this file as shown in quickstart guide of ZendFrameWork. ( I am surprised why httpd.conf file is empty).
5. i also insterd the virtual host code in /etc/apache2/apache2.conf at the end of file. but it still not working....... help me
Zend is very hard to use and it take a lot of time to load websites.
Beacuse it has a lot of libraries.
Refer Codeignitor
But Zend Studio is Good. It has a excellent look and it will tell you everything while you coding.
One error in this post comment. if we submit the form with out entering then success message appearing along with validation messages
ADD: ErrorLog "logs/com.quickstart.local.log"
<VirtualHost *:80>
ErrorLog "logs/com.quickstart.local.log"
</VirtualHost>
in log file found
Options FollowSymLinks or SymLinksIfOwnerMatch is off
Then i Added
<Directory "xxx\php\quickstart\public">
Options Indexes FollowSymLinks
</Directory>
So, looks at this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
#ServerAlias domain.tld *.domain.tld
DocumentRoot C:/xampp/htdocs
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
Instead of the last setting above code, use the virtualHost discussed.
For localhost to work use the top two para.
// satya
in my local OSX snow leopard:
the alias instructions above show:
alias zf.sh=/usr/local/zend/share/ZendFramework/bin/zf.sh
if that alias is created, the commands must be run as:
zf.sh show version
instead I created the alias as:
alias zf=/usr/local/zend/share/ZendFramework/bin/zf.sh
this allows me to run:
zf show version
small tip:
1 open a terminal window
2 type: alias zf=
3 drag and drop the file /usr/local/zend/share/ZendFramework/bin/zf.sh onto the terminal window and the file path is filled-in
zf.sh and zf.php would hang when executed.
Reason:
I already had an older version of Zend configured in my php.ini include_path (for work). After it was removed everything worked like a charm.
<a href="http://www.faisalkaleem.com/php/a-comprehensive-guide-how-to-install-zend-famework.html">www.faisalkaleem.com/php/a-comprehensive-guide-how-to-install-zend-famework.html</a>
I hope you will find much easier guide here.
i waana just MVC archt for showing mysql data through of zend soap server and client and wsdl.
Guys Help Me,
If you can
Cheers!!
After I had put zf create project ..., I didn't have a folder named public...
Thanks in advance!
alias zf=path/to/ZendFramework/bin/zf.shThe article incorrectly says to use:
alias zf.sh=path/to/ZendFramework/bin/zf.shi installed the zend frame work on windows system and i stucked at include_path so please let me know to proceed from here ....
Waiting For your Support
/usr/share/php/libzend-framework-php/ZendAfter I finished this project, this tutorial makes sense. However, I had a hard time to understand the instructions and spent lots of time to read comments and try different things. The following is a tutorial for this tutorial.
Let me explain what I have done:
I installed Zend Server on my Window XP laptop PC. The Zend installer puts Zend Server software to C:\Program Files\Zend directory and created Apache2 and ZendServer directories.
To set up include_path mentioned in this tutorial:
Check PATH Environmental variable has the followings:
"C:\Program Files\Zend\ZendServer\bin";"C:\Program Files\Zend\ZendServer\share\ZendFramework\bin"
Note: To check the PATH, click on 'Start' on Window, right-click on 'My Computer', click on 'Properties', select 'Advanced', click on 'Environmental Variables'. Double-click on PATH in the second window.
To create a project: On DOS terminal,
Go to C:\Program Files\Zend\Apache2\htdocs then type this:
zf create project quickstart
Note: First time I created quickstart project at C:\some_dir, it didn't work. Please someone explain this!
IMPORTANT: copy and paste the subdirectory Zend in C:\Program Files\Zend\ZendServer\share\ZendFramework\library to C:\Program Files\Zend\Apache2\htdocs\quickstart\library, your project library directory.
Note: When you copy the content from files listed in this tutorial, for php files, add <?php on the first line of the file.
Note: All zf commands in this tutorial should be executed at C:\Program Files\Zend\Apache2\htdocs\quickstart\
Note: dada/db should be created at C:\Program Files\Zend\Apache2\htdocs\quickstart
MY PROBLEM:
http://quickstart.local/ works fine. It displays "Welcome to the Zend Framework!..." page.
http://quickstart.local/guestbook and http://quickstart.local/guestbook/sign work!!!
BUT http://localhost/ says 403 Forbidden: You don't have permission to access / on this server. As you know, I checked hosts, httpd.conf, httpd-vhosts.conf. Please help me!
Question: I already have C:\xampp\php\PEAR\Zend and C:\xampp\apache. Are these used at all? It seems it is NOT used at all because of Environmental Variables setup.
My two cents
http://hello-zend.blogspot.com/2011/01/first-application-in-3-steps-first-zend.html
Jonathan, http://JonathansCorner.com/
instructions in the comment by nadie solved the problem on ubuntu 10.10
Too complicated...Convoluted instructions...Etc.
I could more likely hand code something in less time than it would take to get all this working.
While Zend Framework is itself configurationless, you often need to configure your application.this statement couldn't be more inaccurate. configure php.ini. configure virtual host. etc.
the Zend Framework documentation is all over the place. i have been playing with this for several hours and i'm still not sure if i'll be able to run a ZF app on a web server that's hosting many many other apps
still ZF is too promising for me to just ignore. i've used other MVC frameworks and that's definitely the way to go ( MVC )
and just so everyone knows ... once you have the zend library included in your php include_path variable ... you can view the ZF served pages by pointing your browser into the public/ directory. not the project root directory
good luck. i hope this follow up helps
b
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^(/public/|/public)(.*)$
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ public/index.php [R=301]
Watch This
http://www.home-loans.org.za/
This is Great
home loans
Since I have installed Zend Server Community Edition 5.0.3, all I need to do is to add the virtual host configuration as described above into the file with the following path:
C:\Program Files (x86) \Zend\Apache2\conf\httpd-vhosts.conf
I have also added the DNS name quickstart.local into the host into the file with following path:
C:\WINDOWS\system32\drivers\etc
So far everything working wel l...
After starting Apache2.2-Zend, the virtual host "quickstart.local" is activated but it is pointing on the "Zend Server Test Page" when I try to access the URL "http://quickstart.local" although the Document Root is set to: C:/mypath/to/quickstart/public
Has anybody an idea how I can fix this issue?
My problem, solution and explanation:
The following php.ini - Line occured an "PHP5.dll not found on computer..." Error by every php.exe call; eg: 'php -v' / 'zf.bat show version' / etc.
zend_extension_ts="C:\Apache22\modules\xdbug.dll"
If i added the "e", also "xdebug.dll" vs. "xdbug.dll" it will work fine without the "PHP5.dll not found on computer..." Error
BUT: the file "xdebug.dll" would not be found and in the case before ("xdbug.dll"), the file "xdbug.dll" would also not be found but shows in addition the Error "PHP5.dll not found on computer...". It could be a PHP BUG ?! I don't know. But if I get deeper I have noticed, that the Problem comes from the existing "modules/xdbug.dll" file. If I rename the file to "xdebug.dll" and change the PHP.ini Line to "xdebug.dll" I get again the "PHP5.dll not found..." error. It could be, that this Version of xdebug is'nt compatible with my PHP Version ?!
To finaly fix it, to have no "PHP5.dll missing..." Error and no Error for the "xdebug.dll" / "xdbug.dll" "not found", I comented it:
;zend_extension_ts="C:\Apache22\modules\xdebug.dll"
Good Luck
I am keen to get best updates about important things.Please do send me email about these updates.
http://www.auraprint.co.uk
<a href=http://networkmarketinginindia.com/> Network Marketing In India </a>
Joe at http://mlmadvertisingx.com
Zend frame work defines
1. High level goals for each component
2. Design intent of the component
3. Benefit gained from using this component
4. A link to the Programmer's Reference Guide for that component
That's what every web developer needs.
Resolved
xampp already has a previous version of zend frame work.
make sure to over right zf.bat and zf.php along with zend library.
when creating a project and you need to use the absolute path to zend use quotes for the path. Ex:
zf create project "C:\Program Files\Zend etc. etc."
instead of
zf create project C:\ Program Files
The latter will cause a project called "Program" to be created and an error on the "Files" command.
Also, open cmd.exe as an admin (right click, open as administrator) to create new projects in the htdocs folder in apache (it's in the program files folder, accessible only through admin rights, otherwise you'll get a mkdir() error).
hope this helps! :)
Also to activate VirtualHost, just uncomment following line in httpd.conf:
Include conf/extra/httpd-vhosts.conf
Then update dummy vhosts in extra/httpd-vhosts.conf
Certifique-se que o modo de re-escrita está ativo no apache.
Ensure that the re-writing mode is active in apache.
Debian/Ubuntu ----
$ a2enmod rewrite
----------------------
Not sure if this'll entirely fix your problem, but your hosts file shouldn't reference a file path directly - it should just refer to the local machine's ip.
So, instead of :
quickstart.local c:\blah\file\index.php
make it:
quickstart.local 127.0.0.1
This way, when apache receives a request, it looks in the document root path for an index file to serve.
how to configure the apache virtual host and the etc servername
thanks
I try this but not work
apache virtual host
<VirtualHost *:8080>
ServerName quickstart.local
DocumentRoot /ZendLearn/quickstart/public
SetEnv APPLICATION_ENV "development"
<Directory /ZendLearn/quickstart/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
windows etc
127.0.0.1:8080 quickstart.local
Help pls. <a href="http://internationalteachingjobs.org">international teaching jobs</a>
In order to restart Apache (and get the virtual host setup described in the tutorial working) you should issue the following commands in a terminal
net stop Apache2.2-Zend && net start Apache2.2-Zend
(thanks to http://galide.jazar.co.uk/2011/02/zend-server-hosted-on-windows-restart.html) for getting me out of that one
when implementing the "zf create project quickstart", there is a warning that i do not have the phpunit. "this is nothing" i thought.
after 3 days could not get the checkpoint of "welcome page" (500 Internal Server Error), i finally solved this problem by "apt-get install phpunit" and modified
include_path = ".:/etc/php5/zendFramework_1.11.10/library:/usr/share/php:/usr/share/php/PHPUnit"
hope this will be helpful
<a href="http://getoldboyfriendback">Get old boyfriend back</a>
i don't understand i got this error "HTTP Error 404. The requested resource is not found." while i've properly configured the httd-conf file and the host file(Windows 7) i need help please i've been stuck for 24 hours
use ubuntu and eclipse to enjoy the development, it works like sharm, windows s...ks!!
ERROR! Manager of pid-file quit without updating file.for MySQL and I could not login to phpMyAdmin. phpMyAdmin gave the following error:
#2002 Cannot log in to the MySQL serverI went through several things to try to solve this including changing the permissions on /tmp, /private/tmp/, and /usr/local/zend/mysql*. Also, I shutdown two mysqld services via:
ps -axandkill -9 ####where ##### is the pid.
None of that worked but this did:
http://www.worldgoneweb.com/2010/zend-server-community-edition-for-mac-os-x-mysql-problem/
which basically says to call /usr/local/zend/mysql/scripts/mysql_install_db
(Assuming the path to your Zend application's public directory is /var/www/quickstart/public
In /etc/apache2/sites-available/default add :-
<VirtualHost *:80>
ServerName quickstart.local
DocumentRoot /var/www/quickstart/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/quickstart/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
In /etc/hosts add :-
127.0.0.1 quickstart.local
restart/reload apache2 : sudo /etc/init.d/apache2 restart
Works like a charm!
I've double checked everything but I'm still getting this error:
Page not found
Exception information:
Message: Invalid controller specified (quickstart.local)
Stack Trace:
#0 /Applications/MAMP/bin/php/php5.3.6/lib/php/ZF1.11.11/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /Applications/MAMP/bin/php/php5.3.6/lib/php/ZF1.11.11/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /Applications/MAMP/bin/php/php5.3.6/lib/php/ZF1.11.11/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /Applications/MAMP/htdocs/quickstart/public/index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'quickstart.local',
'action' => 'Index',
'module' => 'default',
)
If it makes any difference, I'm not a new developer, so please spare me the "check your typing" line, that's done.
I still assume you have a typo somewhere in your application.ini or another file (maybe the controllers themselves).
Check wether the line
resources.frontController.controllerDirectory = APPLICATION_PATH "/controller[b]s[/b]"is typed correctly and the directory actually exists and contains controllers (the one you actually load from your browser, e.g. /test -> TestController.php).
Same goes for the const APPLICATION_PATH - check if it does point to the correct directory.
I had set the controllerDirectory to "controller" (note the trimmed "s") and got the same error message and stack trace, which lead to this conclusion.
Anyway, if you have found the mistake, I'd be pleased to hear your solution by sending me an email schindhelm ( at ) gmail ( dot ) com.
Kind regards from Germany,
René
you need to add this block in your apache virtual hosts configuration file :
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:\wamp\www"
<Directory c:\wamp\www>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Open <$tagename>
Close </$tagname>
See your's:
<h3>This is your project's main page<h3 />
failed