我知道这个问题已经发布了很多次,但对我来说,这似乎是一个不同的问题。

事实上,这个错误

在C:\xampp\htdocs\site_web\send_mail.php第3行中没有这样的文件或目录 致命错误:require():在C:\xampp\htdocs\site_web\send_mail.php第3行打开required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR')失败

从这一行开始出现在我的代码中:

require 'vendor/autoload.php';

所以,我猜在我的计算机中一定有一个/vendor/autoload.php文件(我已经安装了composer并运行composer require phpmailer/phpmailer)。

所以,我在Windows命令行中使用:dir /s autolload .php查找这个文件,并在这里找到了一个:C:\Windows\SysWOW64\vendor\ autolload .php,

但对我来说,syswow64文件夹没有看到autoload.php,我没有看到我在这里遗漏了什么。


当前回答

修改php.ini中的auto_prepend_file属性

; Automatically add files before PHP document. 
;http://php.net/auto-prepend-file 
auto_prepend_file =

其他回答

出现此错误是因为缺少一些文件,主要原因是“Composer”

首先在CMD中运行这些命令

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

然后 创建一个新项目 例子:

D:/Laravel_Projects/New_Project
laravel new New_Project

之后,启动服务器使用

php artisan serve

我的机器里有这样的路径:

C:/xampp5.0/htdocs/project-recordando-symfony/project-recordando-symfony

然后我运行composer install或/和composer update,它返回以下错误:

ErrorException ZipArchive::extractTo...

这个错误是因为你的路径太长了,我改成:

C:/xampp5.0/htdocs/p-symfony/*

和工作!

@Bashir几乎帮了我,但我需要:

composer update --no-scripts

显然,这可以防止在执行artisan之前包含任何脚本。

我在这页的中间找到了答案: https://laracasts.com/discuss/channels/general-discussion/fatal-error-class-illuminatefoundationapplication-not-found-in-pathtoprojectbootstrapappphp-on-line-14?page=0

运行编写器更新。就是这样

首先,检查index.php中的路由

require __DIR__.'/../vendor/autoload.php';

$app = require_once __DIR__.'/../bootstrap/app.php';

在我的情况下,这条路线行不通,我不得不重新查看目录。