I am running Windows 7 and am using Xampp. I would like to install the Zend framework for PHP, but I am having difficulties understanding how to install it. I have used the Zend framework before, but it was already installed on the Linux system I was working on.
I am reading through the Zend documentation here: http://framework.zend.com/manual/en/learning.quickstart.create-project.html
I am having trouble with updating the includes_path portion. My original include path was include_path = ".;C:\xampp\php\PEAR"
, but I updated it to include_path = ".;C:\Zend"
.
I then followed the directions for creating a new project by opening the command line tool and running % C:\Zend\bin\zf.sh create project testproject
in the desired directory. I get the following error message: '%' is not recognized as an internal or external command, or a batch file
.
Some help with this would be greatly appreciated.
C:\Zend\bin\zf.sh
is for linux, you need C:\Zend\bin\zf.bat
I dont even know how you could run it
To setup ZF you just need to add C:\Zend\library
in your include_path
To fix PHP not found you need to add ;C:\xampp\php\
to the environment variable "Path" from
Click Start
, Right Click on Computer
then click Properties
Then Advanced System settings>Advanced Tab/Environment Variables>System variables>Path/Edit...

Then append to the end ;C:\xampp\php
You should also append ;C:\Zend\bin
for easy access to zf.bat
[2]
Then to create project do not use cd C:\Zend\bin
!! because your project will be created into that directory. Use the full path C:\Zend\bin\zf create project quickstart
or if you did step [2], simply go to your htdocs
(with cd your_htdocs_path
) or whatever you set in apache for web root and execute zf create projext quickstart
you also might need to setup a virtual host "quickstart" in apache and probably new line in windows hosts
file: 127.0.0.1 quickstart
because ZF is designed mainly for virtual hosts
you can install the zend framework using PEAR
pear channel-discover zend.googlecode.com/svn
pear install zend/zend
If you don't know where is your PEAR executable, run a file search for "pear", or "pear.exe".
After that, check out the section called "Setting up the CLI tool on Windows" in http://framework.zend.com/manual/en/zend.tool.framework.clitool.html. It will help you set up a easy access to the zf command line tool.
You can also go to your zendFrame work where you have extracted it and then go to bin folder (in my case “C:\xampp\htdocs\ZendFramework\bin”) where you can find zf.bat . Edit it with any editer and go to
“SET PHP_BIN=php.exe ”
and set it to
“SET PHP_BIN=C:\xampp\php\php.exe”
and it worked for me…
Look's like your trying to run a shell script on cmd, not going to work, try this:
Start > Run > cmd [enter]
> cd C:\path\to\html\docs
> C:\Zend\bin\zf create project quickstart
and do not place the >
marker, just the cd ..
and zf ..
Add the path to the php interpreter to the %PATH% environment variable:
control panel => system => Advanced system settings => Environment Variables... => System Variables => => append ;C:\xampp\php
来源:https://stackoverflow.com/questions/6497257/installing-zend-framework-after-xampp