我正在尝试理解与在系统上"安装"PHP库相关的选项和术语(Linux/OSX)
以下是我要介绍的一些具体要点:
谢谢 - 抱歉多部分......
我刚刚完成了Windows 7的全新安装.我已经安装了Apache,Mysql和PHP 5.3.5全部分开(不使用XAMPP /其他).
我在安装中收到以下错误:错误:无法解压缩phar:// C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0 .2.tar
完整的堆栈跟踪是:
C:\Web\php-5.3.5>go-pear.bat
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : system
Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press Enter to accept these locations.
1. Installation base ($prefix) : C:\Web\php-5.3.5
2. Temporary directory for processing : C:\Web\php-5.3.5\tmp
3. Temporary directory for downloads : …Run Code Online (Sandbox Code Playgroud) 在wampserver上安装PEAR的所有指南,比如Symfony指南,都说我要在一些PEAR目录中运行go-pear.bat脚本.
我在wampserver 2.1上,没有PEAR目录,也没有找到go-pear批处理脚本.
这有什么不同,因为我有一个更新的版本?有什么地方我可以下载这些丢失的安装脚本吗?
哪里可以找到有关PHP_CodeSniffer规则的文档?在我看来,规则存在,但没有人知道它们的列表及其属性.我遇到了基本的问题,我想自定义一个标准,并在语句除以一个空格后在同一行上强制大括号开始,并且看不到任何方法.这只是一个问题,但我还有很多其他问题.谢谢.
我在使用PHPMailer类发送电子邮件时遇到问题,但它适用于PEAR Mail :: factory.
我想问题是SMTP身份验证,但我找不到问题.
有问题的代码是:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = 'mail.xxx.com.br'; // my host here
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = 'xxx@xxx.com.br'; // a valid email here
$mail->Password = '***'; // the password from email
$mail->From = 'from@xxx.com.br';
$mail->SMTPDebug = true;
$mail->AddReplyTo('from@xxx.com.br', 'Test');
$mail->FromName = 'Test SMTP';
$mail->AddAddress('teste@xxx.com.br', 'teste@xxx.com.br');
$mail->Subject = 'Test SMTP';
$mail->IsHTML(true);
$mail->Body = '<b>Teste</b><br><h1>teste 2</h1>';
//$mail->Send();
if(!$mail->Send())
{
echo "Message could not …Run Code Online (Sandbox Code Playgroud) 使用PHP的PEAR,如何检查foo通道中的包是否bar已安装?(假设该频道bar可用,并且已被"发现".)这样的东西只pear list显示在频道中安装的包bar将是理想的.
我阅读了其他PHPUnit安装问题,但没有取得任何成功.我的PEAR安装发生了什么?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed …Run Code Online (Sandbox Code Playgroud) 当试图做
pear install phpunit/PHPUnit
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Failed to download pear/HTTP_Request2 within preferred state "stable", latest release is version 2.0.0RC1, stability "beta", use "channel://pear.php.net/HTTP_Request2-2.0.0RC1" to install
phpunit/PHPUnit can optionally use PHP extension "curl"
phpunit/PHPUnit can optionally use PHP extension "dbus"
pear/XML_RPC2 requires package "pear/HTTP_Request2" (version >= 0.6.0)
phpunit/PHPUnit requires package "pear/XML_RPC2"
No valid packages found
install failed
Run Code Online (Sandbox Code Playgroud)
它说在那里使用另一个频道,但我似乎无法发现或添加该频道!执行此操作的正确命令是什么,或者我还能做什么?
非常感谢,MrB
编辑:
得到它,哇,10s后张贴.
pear install HTTP_Request2-2.0.0RC1
Run Code Online (Sandbox Code Playgroud) 我安装了Mountain Lion,我无法让phpunit工作.
$ pear config-get bin_dir
/Users/greg/pear/bin
$cd /Users/greg/pear/bin
$ls
pear*
peardev*
pecl*
phpunit*
$phpunit
-bash: phpunit: command not found
Run Code Online (Sandbox Code Playgroud) 事实
我正在使用PEAR Mail,我想使用gmail SMTP发送邮件.我有Apache/2.4.27(Win64)PHP/7.2.0beta3,PEAR 1.10.15,Mail 1.4.1,Net_SMTP 1.8.0,Net_Socket 1.2.2.
我去了php.ini并补充道extension = php_openssl.dll.在error.log没有给出SSL相关的错误.
这是代码
require_once "Mail.php";
$from = '<slevin@gmail.com>';
$to = '<slevinkelevra@gmal.com>';
$subject = 'Hi!';
$body = "Hi,\n\nHow are you?";
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => 'ssl://smtp.gmail.com',
'port' => '465',
'auth' => true,
'username' => 'slevinmail@gmail.com',
'password' => 'mypassword'
));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo('<p>' . $mail->getMessage() . '</p>'); …Run Code Online (Sandbox Code Playgroud)