我第一次做的是
在我的linux系统上安装了composer
su到目录用户
在public_html PHPMailer-5_2_23中创建一个目录
更改为该目录
将php mailer上载到该目录
然后从github上的phpmailer上运行提供的composer.json的composer更新如下:https://github.com/PHPMailer/PHPMailer
{
"name": "phpmailer/phpmailer",
"type": "library",
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"require": {
"php": ">=5.0.0"
},
"require-dev": {
"doctrine/annotations": "1.2.*",
"jms/serializer": "0.16.*",
"phpdocumentor/phpdocumentor": "2.*",
"phpunit/phpunit": "4.8.*",
"symfony/debug": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/translation": "2.8.*",
"symfony/yaml": "2.8.*",
"zendframework/zend-cache": "2.5.1",
"zendframework/zend-config": "2.5.1",
"zendframework/zend-eventmanager": "2.5.1",
"zendframework/zend-filter": "2.5.1",
"zendframework/zend-i18n": "2.5.1",
"zendframework/zend-json": "2.5.1",
"zendframework/zend-math": "2.5.1",
"zendframework/zend-serializer": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-stdlib": "2.5.1"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"license": "LGPL-2.1"
}完成之后,我运行了composer命令"require /OAuth2-Google“,如下所示:https://packagist.org/packages/league/oauth2-google
我添加了用户设置以使get_oauth_token.php在浏览器上显示一个令牌,但是我得到了PHP致命错误:
类'League\OAuth2\Client\Provider\Google‘在{my目录}中找不到
因此,我假设有什么东西没有看到这个班,但我几乎找不到任何关于它的任何信息,任何建议或方向?
发布于 2017-05-02 13:40:16
phpMailer是一个库包;它通常被用作更大的应用程序的一部分。在这种情况下,使用Composer安装phpMailer及其依赖项应该是您的主要应用程序。通常情况下,您不希望手动将phpMailer上传到应用程序中,然后只使用Composer,这听起来就像是在做什么。
所以这就是你应该做的。
require_once 'vendor/autoload.php';。https://stackoverflow.com/questions/43738759
复制相似问题