简体   繁体   中英

Using the Built-in Web server and PhpStorm

Built-in PhpStorm Webserver


Working on setting up PhpStorm's built-in server using PhpStorm's Built-in webserver tutorial .

  1. Download PHP 5.4.0 or higher. done
  2. Register the downloaded PHP interpreter in PhpStorm. done
  3. Open your project. done
  4. Appoint the PHP 5.4.0 interpreter configuration for use in the project. done

Technically the files should then be served at: 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:

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. 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:

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. 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. :)

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.

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 :)

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