In case both above solutions do not work, try this following approach:
-
cdto your projects.ideaFolder -
Check if there is a file called
project_name.iml. If this is not the case create it and paste the following content to it<?xml version="1.0" encoding="UTF-8"?> <module type="WEB_MODULE" version="4"> <component name="NewModuleRootManager"> <content url="file://$MODULE_DIR$"></content> </component> </module> -
Then check if there is a file called
modules.xml. If this is not the case create it and paste the following content to it (which targets to your previously createdproject_name.iml)<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/project_name.iml" filepath="$PROJECT_DIR$/.idea/project_name.iml" /> </modules> </component> </project> -
Restart PhpStorm