PHP + Pear|Pyrus + Mail; Mail can't find Pear.php

Wednesday, November 4, 2015

I've been banging my head on this for weeks now. I've found many people with similar issues, and have gotten a little farther towards solving my issue, but not all the way.



WAMPserver 2.5 (PHP 5.5.12)



I originally installed Pear, but something was messed up (paths in config were crazy?), so I tried installing again, and then things got really messed up, so I removed everything Pear-related (except the pear subdir because Windows complained that a file in it was in use, even though it was empty), and gave Pyrus a shot. Now things seem to be working better at least as package management.



I believe I have my include_path(s) set correctly because now my script can at least find the Mail.php script.



include_path = ".;C:\wamp\bin\php\php5.5.12\pear\php"


my call, working:



include_once("Mail.php");


However, Mail.php is now complaining that it can't find Pear.php:



Failed opening required 'PEAR.php' (include_path='.;C:\wamp\bin\php\php5.5.12\pear\php') in C:\wamp\bin\php\php5.5.12\pear\php\Mail.php on line 46



There is no Pear.php file anywhere under \php5.5.12.



Is this happening because I'm using Pyrus, and Mail is set up to work in a Pear environment? (Even though Pyrus claims to be "Using PEAR installation found at C:\wamp\bin\php\php5.5.12\pear", see below.) Do I have to install both Pear and Pyrus? Should I use pyrus.phar to install Pear? As noted above, previous attempts to install Pear were less than successful. The documentation for both Pear and Pyrus could be improved by having a graphic depicting how a standard install ought to look like in terms of subdirs, etc. This is how my include_path branch looks like now:



c:\wamp\bin\php\php5.5.12\pear\php>tree /f
Folder PATH listing for volume OS
Volume serial number is A4D7-1271
C:.
│ Mail.php

├───Auth
│ │ SASL.php
│ │
│ └───SASL
│ Anonymous.php
│ Common.php
│ CramMD5.php
│ DigestMD5.php
│ External.php
│ Login.php
│ Plain.php
│ SCRAM.php

├───Mail
│ mail.php
│ mock.php
│ null.php
│ RFC822.php
│ sendmail.php
│ smtp.php
│ smtpmx.php

└───Net
SMTP.php
Socket.php


Here's my Pyrus config:



c:\wamp\bin\php\php5.5.12>php pyrus.phar get
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52
Using PEAR installation found at C:\wamp\bin\php\php5.5.12\pear
System paths:
php_dir => C:\wamp\bin\php\php5.5.12\pear\php
ext_dir => c:\wamp\bin\php\php5.5.12\ext\
cfg_dir => C:\wamp\bin\php\php5.5.12\pear\cfg
doc_dir => C:\wamp\bin\php\php5.5.12\pear\docs
bin_dir => C:\wamp\bin\php\php5.5.12
data_dir => C:\wamp\bin\php\php5.5.12\pear\data
www_dir => C:\wamp\bin\php\php5.5.12\pear\www
test_dir => C:\wamp\bin\php\php5.5.12\pear\tests
src_dir => C:\wamp\bin\php\php5.5.12\pear\src
php_bin => C:\wamp\bin\php\php5.5.12\php.exe
php_ini => C:\wamp\bin\php\php5.5.12\php.ini
php_prefix =>
php_suffix =>
Custom System paths:
User config (from C:\Users\mrz\pear\pearconfig.xml):
default_channel => pear2.php.net
auto_discover => 0
http_proxy =>
cache_dir => C:\wamp\bin\php\php5.5.12\pear\cache
temp_dir => C:\wamp\bin\php\php5.5.12\pear\temp
verbose => 1
preferred_state => stable
umask => 0022
cache_ttl => 3600
my_pear_path => C:\wamp\bin\php\php5.5.12\pear
plugins_dir => C:\Users\mrz\pear
(variables specific to pear2.php.net):
username =>
password =>
preferred_mirror => pear2.php.net
download_dir => C:\wamp\bin\php\php5.5.12\pear\downloads
openssl_cert =>
handle =>
paranoia => 2
Custom User config (from C:\Users\mrz\pear\pearconfig.xml):
(variables specific to pear2.php.net):


Any help will be greatly appreciated.

0 comments:

Post a Comment