Installing Zend Framework on WAMP Server for Windows
My PC MVC development/test configuration is Windows and
WampServer
and here are easy install instructions on how I use Zend Framework:
1) download and install Zend Framework by putting the Zend folder in a
server directory path (mine is wamp\www). I renamed the current lib
folder to 'Zend' just to keep it simple. And the full or minimal
package works here, but only min is needed for basic examples.
2) add either an include path for the \Zend\library... folder as they
indicate, or copy the \Zend\library\Zend folder into the same library
folder with the rest of this app. The include path in a test index.php
start-up file will find either one. Here is an example of that code:
set_include_path('library'. PATH_SEPARATOR. get_include_path());
This is what I added to my
server's php.ini just for reference:
include_path = ".;c:\wamp\www\zend\library"
(
not the php.ini in the php directory, if you edit this manually)
3) install your test app folder in the server path. (I put it in ..\Zend also).
4) start/re-start your test server.
5) then run your test URL something like this in your browser:
http://localhost/Zend/test/index.php
Here is the default directory structure I use (based on a prior Quickstart):
\wamp\www\Zend\test...
then:
..\application
..\controllers
..\layouts
..\models
..\views
..\data
..\php
..\text
..\xml
..\library (basically empty, where the Zend folder goes if needed)
..\public
..\css
..\js
View
example Zend website (AjaMyAjax) with this design...
Now if trying the QuickStart example app, it might take a bit more effort to run.
I got the current version -- which has changed over time -- to work in WAMP Server
by doing these steps:
First, download the QuickStart app and put it in some folder name in
C:\wamp\www.
I chose to call it:
C:\wamp\www\ZendQuickstart
Then find this apache server file, edit it, and uncomment the 'Include' as shown below:
C:\wamp\bin\apache\Apache2.x.xx\conf\httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Then you need to add something like this to the end of your
httpd-vhosts.conf file
which is found in
C:\wamp\bin\apache\Apache2.x.xx\conf\extra\.
(Of course making any Zend folder name changes you choose to use)
# needed for all WAMP requests that do not match a ServerName
# or ServerAlias in any <VirtualHost> block
<VirtualHost *:80>
DocumentRoot /wamp/www
</VirtualHost>
<VirtualHost *:80>
ServerName quickstart.local
DocumentRoot /wamp/www/ZendQuickstart/public
SetEnv APPLICATION_ENV "development"
# (if needed:)
# <Directory /wamp/www/ZendQuickstart/public>
# DirectoryIndex index.php
# AllowOverride All
# Order allow,deny
# Allow from all
# </Directory>
</VirtualHost>
Then I had to go over to my
C:\wamp\www\ZendQuickstart/public folder
and rename the
.htaccess file to
.htaccess.old to avoid server errors...
Perhaps you can figure out a cleaner way to fix those errors, but this works.
Now stop/restart your WAMP Server and try QuickStart to see if it loads now...
I prefer to run all apps directly, so I use this command line in my browser:
http://localhost/ZendQuickStart/public/index.php
IF you get any Zend level errors, try adding this fix I found as user comments
on the Zend site comment page (if no Quickstart errors, they fixed this/it's gone).
In the ..
/application/bootstrap.php file, add the 'user code...' segment:
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
// user code comment to fix error:
$loader = new Zend_Loader_Autoloader_Resource (array (
'basePath' => APPLICATION_PATH,
'namespace' => 'Application',
));
$loader -> addResourceType ( 'model', 'models', 'Model');
$loader -> addResourceType ( 'form', 'forms', 'Form');
}
...
(Note I added the last line after a form error similar to the model error
the other user found a fix for -- thank you.)
Hope this helps. Best of luck. (also actual
working examples here)
For code examples on using Zend Framework with JavaScript AJAX, try
BasicAjax example...
If Zend with PHP cURL instead of AJAX is what you want, try the
BasiccURL example...
For XAMPP/LAMPP Server installation help instead, try my
XAMPP install page...
AjaMyAjax home page...
Also have you tried fast, free Ubuntu Linux yet, Windows($) users???
Get it here:
Ubuntu download page ...
"Why Ubuntu Linux is better than Windows..."
or IMO at least worth trying before paying for your next O/S upgrade...