Björn
Björn

Reputation: 203

How to create a propper working project with Zend Framework and Wamp 2.2

So i've been at this for 2 days now and i cannot get it to work together. I have installed Wamp 2.2 in a standard manner at c:\wamp, nothing special. I downloaded and extracted the Zend Frameworkm folder and placed the folder it in the C:\wamp\library folder.

So it looks like this :

C:\wamp
   - www
 - ht.acces
 - index.php
   - bin
   - library
  - ZendFramework
      - bin
      - library
      - etc.
   - logs
   - tools
   - etc.

Now as instructed i added both the php location and the Zend framework library to the system variable called PATH wich looks like this : ..;C:\wamp\library\ZendFramework\bin\;C:\wamp\bin\php\php5.3.10\;

Now i can open cmd and type zf create project quickstart, i directed it to create the folder in the www. directory of wamp like this :

C:\wamp
   - www
 - quickstart
    - application
    - data
    - library
    - etc
 - ht.acces
 - index.php
   - bin
   - library
  - ZendFramework
      - bin
      - library
      - etc.
   - logs
   - tools
   - etc.

Now starts the fun part. All the guides around the internet tell me that i should include the location of the library folder inside the ZendFramework folder in the php.ini at the windows version of include_path: "C:\wamp\library\ZendFramework\library".

Now the fun part is that no one mentions exactly wich php.ini file! There are 2 of them as most of you know one in the php directory and one in the apache directory.

And so i come with my first part of my question, wich one do i need?

Wich is soon after followed by part 2, how to propperly set up the virtual host that is supposedly needed to correctly run the zend application in the folder C:\wamp\www\quickstart.

From what i could gather i need to change the file httpd.conf file in the folder C:\wamp\bin\Apache2.2.21\conf\

I need to add something along the lines of

<VirtualHost 127.0.0.1>
     ServerName quickstart
     DocumentRoot "c:\wamp\www\quickstart\public"
    <Directory "c:\wamp\www\quickstart\public">
     AllowOveride all
     Order Allow,Deny
     Allow from all
    <\directory>
<\VirtualHost>

Then after doing so i need to change the host file in the directory c:\windows\system32\drivers\etc. However at that point i am completely lost. My host file looks like this :

 --- standard commented wall of text ---

127.0.0.1       localhost

And at this point the only thing i know that seems to get close to it is that i need to add the line :

127.0.0.1       localhost quickstart

Or something along those lines.

So is there anyone out there with experience regarding Zend Framework that could provide me with an answer? It would be much appriciated :)

Björn -

Upvotes: 1

Views: 2924

Answers (2)

RockyFord
RockyFord

Reputation: 8519

First I'm pretty sure that the php.ini you need to change for web display is the one in the apache folder. (it's been awhile since I've used WAMP).

Next don't build your vhost in your apache config httpd.conf, do it instead in httpd-vhosts.conf. (you don't want to accidently break apache),
The way you stting your vhost at the moment you url will look like http:quickstart/
these two links will help:

Setup Apache vhost
Zend Server Vhosts

One of the key thing with using vhosts is to remember to redo localhost so it doesn't go away.

With you windows hosts file, remeber it must be edited in admin mode and you can have many hosts on the same number, here is an example:

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost
    127.0.0.1       iam.local
    127.0.0.1       zfcms.local
    127.0.0.1       home.local
    127.0.0.1       places.local
    127.0.0.1       RentAFlat.local
    127.0.0.1       zf2-tutorial.local
    127.0.0.1       mp3.local
    127.0.0.1       quickstart

and an example from httpd-vhosts.conf, note: localhost is the first vhost...This is important.

<VirtualHost *:80>
    DocumentRoot "C:\Zend\Apache2/htdocs"
    ServerName localhost
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:\www\iam\public"
    ServerName iam.local
    ErrorLog "C:\Zend\ZendServer\logs\iam.local.log"
    <directory "C:\www\iam">
    Options Indexes FollowSymlinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    </directory>
</VirtualHost>

I hope this helps..

Upvotes: 1

vandalizmo
vandalizmo

Reputation: 377

Looks like You're missing (first of all)

<VirtualHost 127.0.0.1>

   ServerName quickstart
   (...)
<\VirtualHost>

Upvotes: 0

Related Questions