简体   繁体   中英

Controller file missing after default installation of CakePHP in Windows 10

I am new to this and wanted to check out how a Webframework works. I installed CakePHP via Controller in Windows 10. I am using the Windows IIS7 Server and not W/XAMP. I used this video and this documentation. The only thing I did manually besides letting the Controller install CakePHP was setting up the Rewrite Module 2.0 for IIS7 and creating a web config file as in the description here .

Now, when I access " http://localhost/Verzeichnis/CakePHP/my_app_name/webroot " I get Error: WebrootController could not be found.

There is a description under the error: Create the class WebrootController below in file: src\\Controller\\WebrootController.php but I suspect this should be created automatically, right? Also, creating a file with this content brings up other errors that makes me think I should not be forced to do this manually.

composer update in my_app_name does work but does not find anything to update.

Webroot indeed is the directory containing index.php which is entry point of application, but you don't need to include it in your url. Rewrite rules that you set are responsible for rewriting requests and pointing them to their destination.

To access your app, you should simply use url pointing to cakephp root folder, which in your case is probably http://localhost/Verzeichnis/CakePHP/my_app_name/

The solution to this problem was that I did not run the built-in server of CakePHP. I assumed that I have to use the Windows webserver IIS7. But by running

cake server

from the command line in the bin folder of the project (in my case my_app_name ) I could now successfully open the content in the webroot folder via the browser.

This is done by using localhost:8765 (localhost with a different port than the standard port) in the browser.

While this solution worked it would still be interesting to understand what the problem was/is with the Windows ISS7 webserver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM