PhpStorm内置Web服务器不能与PHP一起工作,导致“没有指定输入文件”.错误


PhpStorm Built-In Web Server doesn't work with PHP and cause "No input file specified" error

我刚刚安装了"jetbrains PhpStorm 7.1.3"并正确配置了PHP解释器(PHP 5.5.14)。但使用其内置的web服务器得到No input file specified错误在浏览器的每一个php脚本。

我怎样才能摆脱这个问题?

我的系统是Windows 7 64位。

idea.log的相关部分:

2014-07-26 00:15:37,122 [  57068]   INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342 
2014-07-26 00:15:38,613 [  58559]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/codeStyleSettings.xml file is null 
2014-07-26 00:15:38,628 [  58574]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml file is null 
2014-07-26 00:15:40,204 [  60150]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml file is null 
2014-07-26 00:15:41,577 [  61523]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/IntelliLang.xml file is null 
2014-07-26 00:15:42,528 [  62474]   INFO - dvertisement.PluginsAdvertiser - plugins.jetbrains.com 
java.net.UnknownHostException: plugins.jetbrains.com
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    at sun.net.www.http.HttpClient.New(HttpClient.java:308)
    at sun.net.www.http.HttpClient.New(HttpClient.java:326)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:975)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)
    at com.intellij.ide.plugins.RepositoryHelper.loadPluginsFromRepository(RepositoryHelper.java:72)
    at com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginsAdvertiser$2$1.run(PluginsAdvertiser.java:249)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:420)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:150)
2014-07-26 00:15:43,106 [  63052]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/phing.xml file is null 
2014-07-26 00:15:49,314 [  69260]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/webResources.xml file is null 
2014-07-26 00:15:51,015 [  70961]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 32828 ms 
2014-07-26 00:15:53,963 [  73909]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/cachedDictionary.xml file is null 
2014-07-26 00:16:00,181 [  80127]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/watcherTasks.xml file is null 
2014-07-26 00:18:31,166 [ 231112]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/dataSources.xml file is null 
2014-07-26 00:18:31,213 [ 231159]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dataSources.xml file is null 
2014-07-26 00:18:31,244 [ 231190]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/sqlDataSources.xml file is null 
2014-07-26 00:18:31,260 [ 231206]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/jsLibraryMappings.xml file is null 
2014-07-26 00:18:31,587 [ 231533]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/databaseColors.xml file is null 
2014-07-26 00:18:31,966 [ 231912]   INFO - org.jetbrains.io.BuiltInServer - web server stopped 

在与phpstorm进行了一番斗争之后,我终于找到了解决这个问题的方法。

删除php.ini,使php文件夹中没有php.ini,然后重新启动phpstorm,结果内置web服务器工作正常

今天我遇到了同样的问题。我发现我在错误的文档中创建了项目文件。你应该把php脚本放到"C:'Apache24'htdocs"下的文档中,这取决于你在httpd.conf(文件在C:'Apache24'conf)中的设置。