简体   繁体   中英

Symfony: The file …/config_.yml does not exist

When trying to run the server in the command line with php app/console server:run --env=prod I get:

[InvalidArgumentException]
The file "/Applications/MAMP/htdocs/sym/firstApp/app/config/config_.yml" does not exist.

Tried all the tips I could google for, which are not that many. Somehow the environment is not set. The project is still nearly new created; I'm doing the tutorial .

Some history: After making a template, I had the popular can't create /cache/ directory Exception. I had to set the directory for cache and log manually (with getCacheDir() and getLogDir() in AppKernel) because all the chmod etc. didn't work. When I ran the command with sudo /cache/ was created at the top level ( / ). So I think the project directory isn't set properly too.

Using symfony installer 1.1.7, PHP 5.5.27, Max OS X.

Try to clear your cache with this command line :

php app/console cache:clear --env=prod

because you are trying to run symfony in production mode.

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