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.
- Right click on your project and select Set as Main Project, if not already
- Right click again and select Properties
- Under Run Configuration, choose Run As: and select Local Web Site (running on local server
- Make sure your Project URL points to your web server (for example: http://localhost/myproject/)
- Make sure your Index File is correct.
This all assumes that you are using a local webserver (example: Zend Server CE, or WAMP).
精彩评论