Jump to content

PHP framewok issues

- - - - -

  • Please log in to reply
2 replies to this topic

#1
ferovac

ferovac

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
I got a project that needs to be done in using Zend framework, my problem is with setting up a vhost on my apache server for that specific project

Ill write all the steps i took :

1. i created a new PHP project with Zend in netBeans , result netbeans generates all zend folders and files for the project
2. i added the zend library files in /library folder so i now have /library/zend, at this point when i fire up a browser and point it at localhost/myZendProject/public i get a default zend welcome page
3. in docs/readme is a "advice" and a templet for setting a VHOST, so i go ahead and set it up

lets say my host name is myZendProject

when i point a browser to http://myZendProject i get :


Internal Server Error


The server encountered an internal error or misconfiguration and was unable to complete your request.


Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.


More information about this error may be available in the server error log.

this is not the first time that im setting up a VHOST, and this isnt the only VHOST on my apache, all of them are running fine except this one, so im guessing that there is something wrong with zend framework, i ve also tried to set up only the zend project on a apache but the same error keep poping up .

the vhost templet

Setting Up Your VHOST

=====================


The following is a sample VHOST you might want to consider for your project.


<VirtualHost *:80>

   DocumentRoot "/var/www/myZendProject/public"

   ServerName myZendProject.local


   # This should be omitted in the production environment

   SetEnv APPLICATION_ENV development

    

   <Directory "/var/www/myZendProject/public">

       Options Indexes MultiViews FollowSymLinks

       AllowOverride All

       Order allow,deny

       Allow from all

   </Directory>

    

</VirtualHost>


#2
ferovac

ferovac

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
Ive been playing with it a bit .

When i remove /public from vhost config , so when i put this as the vhost config:

Quote

<VirtualHost *:80>
DocumentRoot "/var/www/myZendProject"
ServerName myZendProject.local

# This should be omitted in the production environment
SetEnv APPLICATION_ENV development

<Directory "/var/www/myZendProject">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

after that when i go to http://myZendProject
i get this :

Quote

Index of /
[ICO] Name Last modified Size Description
[DIR] application/ 05-Apr-2011 11:48 -
[DIR] docs/ 05-Apr-2011 11:48 -
[DIR] library/ 05-Apr-2011 12:11 -
[DIR] nbproject/ 05-Apr-2011 11:48 -
[DIR] tests/ 05-Apr-2011 11:48 -
Apache/2.2.16 (Ubuntu) Server at myZendProject.local Port 80

but when i access the project like this http://localhost/myZendProject/ i get this :

Quote

Index of /myZendProject
[ICO] Name Last modified Size Description
[DIR] Parent Directory -
[DIR] application/ 05-Apr-2011 11:48 -
[DIR] docs/ 05-Apr-2011 11:48 -
[DIR] library/ 05-Apr-2011 12:11 -
[DIR] nbproject/ 05-Apr-2011 11:48 -
[DIR] public/ 05-Apr-2011 11:48 -
[DIR] tests/ 05-Apr-2011 11:48 -
Apache/2.2.16 (Ubuntu) Server at localhost Port 80

notice how the red line is missing when i use http://myZendProject/ , so why is that ???

#3
ferovac

ferovac

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
Ok, ive found the solution for the problem.

The problem is in mod_rewrite, which as i assumed based on a article that is loaded by default in the apache, but as it turns out it isn't.

So the solution

run this in the terminal :
sudo a2enmod rewrite

this should enable the mod_rewrite on your apache
after that restart the apache so the module can be loaded into the apache :
sudo /etc/init.d/apache2 restart
now to check if the mod_rewrite is loaded go to /etc/apache2/mods-enabled , you should see a line like this
rewrite.load

and your done!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users