开发者

First project with Zend framework on netbeans not working properly

I've installed the latest Zend Framework on the latest netbeans application and I've created my first project succesfully

The only problem I have is when I hit Run on netbeans it doesn't show the actual web page, it shows me the directory where I saved the project to instead of the Public folder.

I've followed the instructions on their quickstart guide but I can't seem to fix that problem.

开发者_如何学编程

Anyone have a suggestion?


Had the same problem, When you open http://localhost/myproject/ it shows the directories, but when you try http://localhost/myproject/public/ you can run the index.php file there, and see the default website.

Use the codes explained Survive the Deep End and create a virtual host that uses public folder.

Simply, create a file named myproject.tld in /etc/apache2/sites-available/

then configured put the following codes to load from public folder, whenever you load it.

# Setup "myproject.tld" Virtual Host
<VirtualHost *:80>
ServerName myproject.tld
DocumentRoot /var/www/myproject/public

<Directory /var/www/myproject/public>
    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Then used the commands

sudo a2ensite myproject.tld
sudo /etc/init.d/apache2 reload

And at last, edit /etc/hosts and insert the next line 127.0.0.1 myproject.tld

After these, opening http://myproject.tld/ will be working correctly.


You have to configure Netbeans to run your project correctly; it's not Zend's fault.

  1. Right click on your project and select Set as Main Project, if not already
  2. Right click again and select Properties
  3. Under Run Configuration, choose Run As: and select Local Web Site (running on local server
  4. Make sure your Project URL points to your web server (for example: http://localhost/myproject/)
  5. Make sure your Index File is correct.

This all assumes that you are using a local webserver (example: Zend Server CE, or WAMP).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜