Ec (2); today I found myself fooled, depressed, and hellip; & nbsp; when I first looked at the zend framework, it feels like someone tells me the portal file (index. php) must be placed on the website with a base address! Then, I moved all the files in the htdocs folder (I installed the xampp installation package, and it is said that this is the base address directory, come on, please come in with zend. I tried it and succeeded. Oh, I am still a senior in my mind, "script" ec (2); "script"
Today I found myself fooled, depressed ......
When looking at the zend framework at the beginning, it seems that whoever tells me that the entry file (index. php) must be placed on the website with a base address!
Then, I moved all the files in the htdocs folder (I installed the xampp installation package, and it is said that this is the base address directory, let's invite zend. I tried it and succeeded. Oh, I am still happy.
Later I found out that, isn't my computer only capable of having one website? Because all of them start with index. php In this zend? Unhappy, I searched the internet for a round, and I was not enough to search people! I found it, haha,
The basic practice is as follows:
1. Move your website file to the folder you want, such as zend
2. Add a domain name in C: WINDOWSsystem32driversetchosts, such
.......
127.0.0.1 zendhost
In fact, a domain name is resolved locally.
3. Add the following content at the end of the apacheconfhttpd. conf file:
............
NameVirtualHost 127.0.0.1
ServerName zendhost
DocumentRoot D: xampphtdocszend
RewriteEngine On
OK, restart. Enter zendhost in the address bar and press Enter,
This is the last thing we can do, but it's ridiculous that it's now from my colleagues today. Originally, there was no such complexity. In fact, you can put it in any folder and enter it in the address bar, such as 127.0.0.1/zendhost! I then looked at the code again, and I added a sentence in index. php:
$ Controller-> setBaseUrl ('/'); so all requests are forwarded to the root directory!
Ah
<