Rik Scholten
Rik Scholten

Reputation: 11

Moving a site (drupal8) to MAMP, autoload.php error

Somebody send me a site to work on so I setup my MAMP webserver, extracted the drupal8 files into the htdocs folder, I setup the database in phpMyAdmin and run the MAMP servers.

When I try to reach localhost I get a HTTP ERROR 500, of-course I check the logs for errors and find this:

[02-Aug-2017 16:14:24 UTC] PHP Warning: require(C:\MAMP\htdocs/../vendor/autoload.php): failed to open stream: No such file or directory in C:\MAMP\htdocs\autoload.php on line 17

[02-Aug-2017 16:14:24 UTC] PHP Fatal error: require(): Failed opening required 'C:\MAMP\htdocs/../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\MAMP\htdocs\autoload.php on line 17

I thought this had something to do with composer so I reinstalled it and ran cmd

composer install

In installed some files + generated some autoload files which is what i thought was going to solve my problem, but i still get the same error and i feel like im missing something really obvious. Ive been stuck for so long on a small problem.

Hope someone has an answer for me!

Upvotes: 0

Views: 464

Answers (1)

Rik Scholten
Rik Scholten

Reputation: 11

SOLVED

It was a pathing error in the autoload.php file

return require DIR . '../vendor/autoload.php';

changed to:

return require DIR . '/vendor/autoload.php';

Upvotes: 1

Related Questions