Search code examples
phpapixamppvimeo

My folder is not opened in XAMPP localhost


Guys i am frustrated now, I just installed XAMPP yesterday. And I created a folder named "MyProgram" and there is one PHP file inside and basically its just a "Hello World" program. It works fine in the apache localhost.

And now when I created another new folder "MyAPI", I am trying to build another PHP thing with Vimeo API. But this time, no matter how many times I tried, I cant open my "MyAPI" folder on the localhost anymore. Usually when we open in the localhost, there will be a menu for us to choose what file to be opened, but im not sure why this is not working in this case. These are the error message:

Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in D:\XAMPP\htdocs\MyAPI\index.php on line 9

Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='D:\XAMPP\php\PEAR') in D:\XAMPP\htdocs\MyAPI\index.php on line 9

And FYI, this my folder: enter image description here

And this is how I installed my composer: enter image description here


Solution

  • You need to install your project dependencies first.

    1. Open your terminal

    2. Navigate to your project directory: cd D:\XAMPP\htdocs\MyAPI\

    3. Run composer install