Hi,
I'm running the latest master from today (I tried the upgrade because of this problem, it stays the same with 1.2 beta). Whenever trying to send a message I get the following error message:
[07-Feb-2016 13:58:06 UTC] PHP Fatal error: Cannot declare class PEAR, because the name is already in use in /data/www/roundcube/vendor/pear/pear-core-minimal/src/PEAR.php on line 84
It was working before. I assume the problem was introduced with the update to php 7.0.3?!
Thanks,
Felix
Do you have Pear installed globally or something like that?
Yes, pear is installed as a dependency.
You cannot have Pear installed twice or you get the errors like you are seeing. So if you have installed it globaly then do not install it as part of Roundcube (assuming what you already have installed meets the Roundcube requirements)
So I uninstalled all global PEAR versions, still same error message.
I then moved the roundcube/vendors/pear folder and got errors that the files in that directory are missing, so how would I get rid of the roundcube pear version?!
So I noticed something:
under roundcube/vendor/ there are two pear folders:
pear
pear-pear.php.net
both have similiar content:
c_apache vendor # ll pear/
total 0
drwxr-x--- 1 apache apache 118 Jan 9 11:37 console_getopt
drwxr-x--- 1 apache apache 76 Jan 9 11:37 net_socket
drwxr-x--- 1 apache apache 52 Jan 9 11:37 pear-core-minimal
drwxr-x--- 1 apache apache 92 Nov 23 15:53 pear_exception
c_apache vendor # ll pear-pear.php.net/
total 0
drwxr-x--- 1 apache apache 14 Jan 9 11:57 Archive_Tar
drwxr-x--- 1 apache apache 8 Jan 9 11:37 Auth_SASL
drwxr-x--- 1 apache apache 22 Jan 9 11:57 Console_CommandLine
drwxr-x--- 1 apache apache 14 Jan 9 11:57 Console_Getopt
drwxr-x--- 1 apache apache 24 Jan 9 11:37 Crypt_GPG
drwxr-x--- 1 apache apache 8 Jan 9 11:37 Mail_Mime
drwxr-x--- 1 apache apache 6 Jan 9 11:37 Net_IDNA2
drwxr-x--- 1 apache apache 6 Jan 9 11:37 Net_SMTP
drwxr-x--- 1 apache apache 6 Jan 9 11:57 Net_Sieve
drwxr-x--- 1 apache apache 6 Nov 23 15:53 Net_Socket
drwxr-x--- 1 apache apache 106 Jan 9 11:57 PEAR
drwxr-x--- 1 apache apache 20 Jan 9 11:57 Structures_Graph
drwxr-x--- 1 apache apache 6 Jan 9 11:57 XML_Util
I have never done anything with the vendor folder. I just downloaded the 1.2 beta a while ago and upgraded from the old 1.1.x version. It was working fine for a while, but then suddenly stopped.
Remove vendor folder and run composer install again.
THe install fails:
- Installing pear-pear.php.net/auth_sasl (1.0.6)
Loading from cache
- Installing pear-pear.php.net/console_commandline (1.2.1)
Loading from cache
- Installing pear-pear.php.net/crypt_gpg (1.4.0)
Loading from cache
- Installing pear-pear.php.net/mail_mime (1.10.0)
Loading from cache
- Installing pear-pear.php.net/net_idna2 (0.1.1)
Loading from cache
- Installing pear-pear.php.net/net_socket (1.0.14)
Loading from cache
- Installing pear-pear.php.net/net_smtp (1.7.1)
Loading from cache
- Installing pear-pear.php.net/xml_util (1.3.0)
Loading from cache
- Installing pear-pear.php.net/structures_graph (1.1.1)
Loading from cache
[UnexpectedValueException]
Failed to extract PEAR package /data/www/roundcube/vendor/pear-pear.php.net/Structures_Graph/Structures_Graph-1.1.1.tgz to /data/www/roundcube/vendor/pear-pear.php.net/Structures_Graph
. Reason: phar error: tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered
[UnexpectedValueException]
phar error: tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered
Ok, this seems to be a php 7 bug:
https://bugs.php.net/bug.php?id=71317&thanks=6