"Unknown: Failed opening required" error when following slimphp manual


  • QA Engineer

    I'm testing the Slim Framework on a machine with Windows 10, already in the first instructions I received the error:

    Fatal error: Unknown: Failed opening required 'public\public/index.php' (include_path='.;C:\php\pear') in Unknown on line 0
    

    I searched other related threads and saw that it may be something with permissions but I have already given master permission in both the PHP directory and the project directory.

    Follow my settings:

    • Folder location:

      C:/php
      
    • Project location:

      D:\git\slim-saa
      
    • PHP version:

      PHP 7.1.12 (cli) (built: Nov 23 2017 04:21:28) (ZTS MSVC14 (Visual C++ 2015) x6 4 ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

    Project https://github.com/getJv/slim-saa .

    I'm following exactly the https://www.slimframework.com/ and lift the built-in server with the command:

    php -S localhost:8080 -t public public/index.php
    

    Run on the root (slip-saa folder)

    Can anyone give me a light on how to circumvent this situation?



  • I managed to run without errors by removing the command public:

    The Slim Framework website says to run like this:

    $ cd [my-app-name]; php -S localhost:8080 -t public/index. php

    I got success running like this:

    $ cd [my-app-name]; php -S localhost:8080 -t public index.php




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2