Jump to content

[SOLVED] Zend Framework and WAMP


ma2tt

Recommended Posts

I'm trying to install Zend Framework on my laptop to familiarise myself with it. I already have WAMP installed with a dozen or so website projects sitting in the WAMP server root (c:\wamp\www).

 

The installation instructions that I have followed so far include a .htaccess file to reroute everything to index.php. Am I right in thinking that Zend Framework effectively takes over the whole server?

 

I still need access to the existing projects already in the WAMP server root without using ZF. How do I achieve that? Does ZF require its own dedicated server?

 

I'm kinda new to this (if you didn't already guess! haha)

 

Thanks

Matt

Link to comment
Share on other sites

The installation instructions that I have followed so far include a .htaccess file to reroute everything to index.php. Am I right in thinking that Zend Framework effectively takes over the whole server?

 

Nope, ZEND doesn't take over anything. The .htaccess that you place in a folder does affect all sub-folders though.

 

I still need access to the existing projects already in the WAMP server root without using ZF. How do I achieve that? Does ZF require its own dedicated server?

 

I have my XAMMP and WAMP servers setup with sub directories.

 

C:/wamp/www/
C:/wamp/www/zend/
C:/wamp/www/project1/
C:/wamp/www/project2/

 

The answer is to use RewriteBase in your rewrite rules. See this topic:

http://codeigniter.com/forums/viewthread/85429/

 

Also, if you want to install Xdebug for testing I made a video about it here.

 

Link to comment
Share on other sites

It just has to be present in the include_path. That's basically how you "install" it.

 

For each project I prefer to give it it's own hostname and it's own VirtualHost in Apache. I just edit the hostfile and make something like e.g. dev.phpfreaks point to 127.0.0.1. Then I setup a new vhost.

Link to comment
Share on other sites

  • 1 month later...

I also try to install and try ZF but on XAMMP.

In my httdocs I have plenty installed projects, but it seems that I cant configure the .htaccess file  ??? .....eg

I create a project in the following directory :

C:\xampp\htdocs\Quickstart

I have the below folders

application                                                                                        <DIR>

data                                                                                                <DIR>

library                                                                                            <DIR>

public                                                                                              <DIR>

scripts 

 

Now ....where should I put the  .htaccess file and what changes should I make to it?

Link to comment
Share on other sites

Thanks..... I have installed the "ZendFrameworkQuickstart" application on my XAMMP under the folder C:\Program Files\xampp\htdocs\Quickstart

but when I run a

http://localhost/Quickstart/public/

 

get the error.....

 

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\Quickstart\public\index.php on line 12

 

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='C:\Program Files\xampp\htdocs\Quickstart\application\/../library;.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\Quickstart\public\index.php on line 12

 

I think I should change the htaccess and perhaps bootstrap but don't understand where and what path should I put????

Link to comment
Share on other sites

  • 4 months later...

BUMP!

 

I'm having similiar problems (I have a WAMP setup). Working through their quickstart guide, I successfully created the project - but when I try to navigate to the project folder - all the folders are visible EXCEPT public. When I try to access this folder, I get an internal server error. Any ideas?

 

example:

 

[DIR] application/

[DIR] library/

[DIR] tests/

 

where's freaking public!?

Link to comment
Share on other sites

Sounds to me like you've actually put application, library and tests within your public directory.

 

Anyways, you people really ought to look into how to configure vhosts on Apache instead of panting all your projects within one single document root.

Link to comment
Share on other sites

Sounds to me like you've actually put application, library and tests within your public directory.

 

do you mean wamp's www directory?

Basically, I created the project within wamps www directory because (as I understand it) it needs to be in there to parse the PHP correctly.

All the folders are in one location:

 

C:\wamp\www\sites\study\Zend\quickstart :(application, library, public, tests)

 

ZF is here - and reference via the include_path in php.ini

 

C:\wamp\ZendFramework

 

Is that problematic?

Link to comment
Share on other sites

No its not problematic, but the only files out of that entire structure that need to be within an accessible web root are the files within public (eg; .htaccess and index.php). The rest can be wherever you like.

Link to comment
Share on other sites

to be fair, they were all unpacked to a single project folder when I executed "zf create project quickstart" from the cmd (as in the quickstart tutorial on Zend's site).

 

Indeed. But you can easily setup a virtual host on apache to make public the only publicly accessible directory. Hence, why its named public.

 

So why is public not visible to localhost?

 

I've no idea. Where is your servers document root?

Link to comment
Share on other sites

Does the public folder not show up in the filesystem either?

 

Nah, I think the op has stated the public directory shows in his filesystem, but not when view via apache directory browsing.

 

Makes me think he has somehow installed application, library and tests into public. Seems odd though.

Link to comment
Share on other sites

Feel free - as long as you help me solve it!

 

yup, you're telling me. Can't figure it out for the life of me. I work with WAMP on a daily basis, so I can't understand why it wouldn't show a folder - and all my other projects are functioning fine. Incidentally, @Daniel10, I unpacked your tarball into the same folder, and still no public folder.

 

Anyway, here's some progress - I removed the htaccess file form within the public folder - it became visible, and now I've been able to access the framework. Soooo, it's something to do with the .htaccess I guess. Since neither vhosts or .htaccess are my strong suit, can you think of why this might be causing an issue?

Link to comment
Share on other sites

Okay, seriously, check this out:

 

C:\windows\system32\drivers\etc\hosts:

127.0.0.1 dev.yourproject

 

C:\path\to\your\httpd.conf:

<VirtualHost *:80>
ServerName dev.yourproject
DocumentRoot C:\path\to\your\zfproject\public
<Directory C:\path\to\your\zfproject\public>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
	AllowOverride All
</Directory>
</VirtualHost>

 

Restart Apache, go to http://dev.yourproject

 

If that doesn't work, something is seriously wrong with your setup.

Link to comment
Share on other sites

Nope, same problem. Not sure what the problem is, only that it seems to work if I remove the .htaccess file:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

 

I'll try this on a different WAMP setup to see if it's just my current setup.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.