简体   繁体   English

使用内置的Web服务器和PhpStorm

[英]Using the Built-in Web server and PhpStorm

Built-in PhpStorm Webserver 内置PhpStorm Web服务器


Working on setting up PhpStorm's built-in server using PhpStorm's Built-in webserver tutorial . 使用PhpStorm的内置网络服务器教程来设置PhpStorm的内置服务器

  1. Download PHP 5.4.0 or higher. 下载PHP 5.4.0或更高版本。 done 完成
  2. Register the downloaded PHP interpreter in PhpStorm. 在PhpStorm中注册下载的PHP解释器。 done 完成
  3. Open your project. 打开您的项目。 done 完成
  4. Appoint the PHP 5.4.0 interpreter configuration for use in the project. 指定用于项目的PHP 5.4.0解释器配置。 done 完成

Technically the files should then be served at: http://localhost:63342/<projectname>/ 从技术上讲,这些文件应随后在以下位置提供: http://localhost:63342/<projectname>/

But I am getting this error: 但我收到此错误:

Fatal error: Uncaught exception 'RuntimeException' with message 'Install dependencies to run this script.' in C:\code\<projectName>\vendor\doctrine\mongodb-odm\tools\sandbox\config.php:9 
Stack trace: 
#0 C:\code\<projectName>\vendor\doctrine\mongodb-odm\tools\sandbox\index.php(3): require_once() 
#1 {main} thrown in C:\code\<projectName>\vendor\doctrine\mongodb-odm\tools\sandbox\config.php on line 9

--Line 9 is, as one would expect: -第9行,正如人们所期望的那样:

if (!file_exists($file = __DIR__.'/../../vendor/autoload.php')) {
    throw new RuntimeException('Install dependencies to run this script.');
}

This, at first, made me think that I was missing a dependency file in my php.exe/php.ini. 首先,这使我觉得我在php.exe / php.ini中缺少依赖项文件。 But after looking in the files a bit I started to think that that might be the wrong track... 但是在查看了一些文件之后,我开始认为那可能是错误的路线...

-- Then I searched for installing dependencies for doctrine and found this: - 然后我搜索了关于安装教义的依赖项,发现了这一点:

doctrine/mongodb-odm-bundle

-- Which I then ran using require: - 然后我使用require运行:

composer require mongodb-odm-bundle

This updated the dependency file but did not solve the problem. 这更新了依赖性文件,但没有解决问题。 I have a feeling that this is something simple that I am missing, but I am either googling the wrong thing or completely ignorant of the path to follow to find the information. 我感觉这很简单,我很想念它,但是我要么搜索错误的东西,要么完全不知道要查找信息的路径。

I'm about 800 hours into coding maybe 120 hours into php and 80 hours into PhpStorm. 我大约要花800个小时来编写代码,可能要花120个小时来编写php,而要花80个小时来编写PhpStorm。 Let me know if anyone has an idea as to where to start on this problem. 让我知道是否有人对从哪里开始这个问题有想法。 My current method is a bit too shotgun for my tastes. 我目前的方法对我的口味来说有点shot弹枪。 :) :)

It seems that your dependencies are not installed, try running composer install (fixing errors that may or may not pop up) and afterwards your script should be running fine. 似乎您的依赖项未安装,请尝试运行composer install (修复可能会弹出或可能不会弹出的错误),然后脚本应该可以正常运行。

For what it's worth doctrine/mongodb-odm-bundle is not required for ODM to work properly, it's just a bundle to integrate library with Symfony :) 对于值得的doctrine/mongodb-odm-bundle不需要ODM正常工作,它只是将图书馆与Symfony集成在一起的捆绑包:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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