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

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!

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';

Related

autoload.php missing when its there

I have started a new Laravel Project and wanted to test it on my localhost...
When I view the site I get an error message saying:
Warning:
require(C:\xampp\htdocs\public/../Website/vendor/autoload.php): failed
to open stream: No such file or directory in
C:\xampp\htdocs\Website\public\index.php on line 24 Fatal Error:
require(): Failed opening required
'C:\xampp\htdocs\Website\public/../Website/vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\Website\public\index.php on line 24
I looked it up, but I found the autoload.php file in all folders and I already tried composer update --no-scrips. I just don't get why it isn't loading the project.
'Website' is the name of my Laravel project folder btw.
I fixed the problem thanks to apokryfos.
In the autoload file the DIR.'/../vendor/autoload.php' was changed to DIR.'/../Website/vendor/autoload.php' which was the wrong path. I don't know how this could happen, but simply deleting the 'Website/' seemed to fix the problem.
Thanks again to apokryfos.
Turns out I didn't enable openssl in my php.ini so when I created my new project with composer it was installed from source. I changed that and ran
composer update
now the vendor folder was created

Repo not working in localhost using laravel

I am new to this but I am trying to view a repository through localhost and I am receiving this php error in the mamp log:
PHP Warning: require ..... failed to open stream: No such file or directory in .......autoload_real.php on line 58
PHP Fatal error: require(): Failed opening required
....autoload_real.php on line 58
On Line 58 is the following:
function composerRequireec02cd7cea0c14cd8638fe929f5e7e81($file)
{
require $file;
}
I think it might have something to do with the laravel version but i'm not sure. The other thing is that when I try to see errors in the laravel log there is no log in app/storage
First give the read permission to storage and bootstrap directory in your laravel project and then reload your laravel project in browser.
It seems to work now after doing composer-dump autoload then a composer update, although I was looking for more of a global answer as to why this might be happening (i.e. outdated laravel version etc.). But thanks everyone!

Require_once(Net/URL2.php): failed to open stream: no such file or directory

I installed the pear/http_request2 version 2.2.1 using Composer in my project but when I am trying to make my first request I am getting this Warning and Fatal error:
Warning: require_once(Net/URL2.php): failed to open stream: No such
file or directory in
/Applications/XAMPP/xamppfiles/htdocs/jet/vendor/pear/http_request2/HTTP/Request2.php
on line 24
Fatal error: require_once(): Failed opening required 'Net/URL2.php'
(include_path='/Applications/XAMPP/xamppfiles/htdocs/jet/vendor/pear/pear_exception:.:/Applications/XAMPP/xamppfiles/lib/php')
in
/Applications/XAMPP/xamppfiles/htdocs/jet/vendor/pear/http_request2/HTTP/Request2.php
on line 24
I appreciate any help on how to fix it, thanks in advance.
David.
This should work:
composer require pear/http_request2:2.2.1
By default pear/net_url2 should be installed which has the required URL2.php file (./vendor/pear/net_url2/Net/URL2.php).
Then make sure you're including vendor/autoload.php file in your scripts to load automatically the include paths (see: vendor/composer/include_paths.php file).
Here is a simple PHP command to test this out:
php -r 'require_once "vendor/autoload.php"; require_once "Net/URL2.php";'
Note: The above command should run without any errors.
Related: Errors in the autoloaded HTTP/Request2 code, how to troubleshoot composer?
You need HTTP_Request2 from git master, because it has not been released/tagged yet at the time of writing.

XAMPP Permission Denied for Require_Once Mac OS X Yosemite

Problem:
I'm trying to open headerr.php via require_once on a XAMPP localhost server. I'm calling this function through index.php but I keep on receiving the following error message
Errors:
Warning: require_once(/Applications/XAMPP/xamppfiles/htdocs/Baseline/headerr.php): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/Baseline/index.php on line 2
Fatal error: require_once(): Failed opening required 'headerr.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/Baseline/index.php on line 2
Attempted Solutions:
-I've tried setting the permissions to Read & Write for everyone on the (/Applications/XAMPP) Folder but that hasn't fixed the permissions issue.
-I've also tried using require_once dirname(FILE) . '/headerr.php'; but that didn't work either..
In Conclusion:
I suspect that I may have to edit the php.ini file but I have no clue what to do..
I appreciate any advice or insight, thanks!
Try this command:
chmod -R 775 yourWebFolder

Installing Laravel resulted in unable to find the socket transport ssl

Hi I am trying to install laravel on my server.This is what I did.First I installed composer and tryed running this command in cmd:
composer create-project laravel/laravel RestPHP
After running it I got this this message:
I tryed googeling about this error but could not find anything concrete regarding this error I am very new to php.
After this I tryed a more manual approach.I downloaded laravel and put it in my htdocs folder , then I tryed openning it like this:
http://localhost:8585/laravel/public/
But I got this message:
Warning: require(E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php'
(include_path='.;E:\Projects IDE\PHPStorm\xampp\php\PEAR') in
E:\Projects IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php
on line 17
I have my htdocs route at:
E:\Projects IDE\PHPStorm\xampp\htdocs
Both cases seem to be some for of php configuration problem , since I have 0 knowledge of that I could not find a solution.
Could someone please provided me with a step by step solution?
UPDATE
I managed to enable socket transparency ssl and after trying to run the command I get this:
I have also installed git but I still get the same error.What can I do?
Try enabling php_sockets and open_ssl in your php ini

Categories