Codecept installation gives me an fatal error (bz2 extension) - php

I am trying to setup Codeception (v1.8) on my local development box (Windows 7 running WAMP).
I have PHP 5.3.13 running and both CURL and bzip2 are enabled modules, when I run the following command to install the 'framework' I get the following error:
php codecept.phar bootstrap
PHP Fatal error: Uncaught exception 'PharException' with message 'bz2 extension is required for bzip2 compressed .phar file "C:\wamp\www\codecept\codecept.phar"' in C:\wamp\codecept\codecept.phar:3
Stack Trace:
#0 C:\wamp\www\codecept\codecept.phar(3): Phar::mapPhar()
#1 {main}
thrown in C:\wamp\www\codecept\codecept.phar on line 3
......
I have 5.3 running so haven't installed the latest version of Codecept (v2) as that doesn't work with my version of PHP but cannot be sure why this is happening?
Any ideas
P.S I will be using this Codecept with Yii eventually if that makes any difference

I had the same problem and uncommenting 'extension=bz2.so' in my php.ini file fixed it.

the problem you have is because the v2 of codeception requires at least php5.4, downgrade to some of the 1.x versions than you will have no problem.
Here is the link for the versions

Related

PHP grpc extension not working on WAMP, despite working on CLI

After about a week of trying to install grpc for Firestore with PHP, I managed to get it working, however only when ran in terminals / cmd. This php.ini / environment is on my desktop in a folder and when executing files with firestore commands it works. No errors.
However, when in WAMP, it crashes the page with:
Fatal error: Uncaught Google\Cloud\Core\Exception\GoogleException: The requested client requires the gRPC extension. Please see https://cloud.google.com/php/grpc for installation instructions. in D:\wamp64\www\karma\vendor\google\cloud-core\src\ClientTrait.php:76 Stack trace: #0 D:\wamp64\www\karma\vendor\google\cloud-firestore\src\FirestoreClient.php(139): Google\Cloud\Firestore\FirestoreClient->requireGrpc() #1 D:\wamp64\www\karma\functions.php(32): Google\Cloud\Firestore\FirestoreClient->__construct(Array) #2 D:\wamp64\www\karma\Firestore.php(8): Firestore->__construct('test') #3 {main} thrown in D:\wamp64\www\karma\vendor\google\cloud-core\src\ClientTrait.php on line 76
Now what is really weird is that I copied the directory from desktop and literally pasted it into the WAMP PHP area and there is no difference. It even says in the config that php_grpc is loaded! I dont think the bottom dlls are needed so I don't think its an issue they're missing but I find it incredibly strange the same directory on the desktop will run php files from the command line but not in WAMP. WAMP is 64 bit and so is the plugin. PHP version of wamp was 7.0.1 but I replaced the whole 7.0.1 folder with the new 7.4.x version as with the plugin of that version.
Why would it say its loaded and yet say it isnt?
I too have have the same issue.I tried all possible ways to fix it.The extension is loaded in waamp but the php shows missing error.
I had to completely reinstall wamp to fix this error, in a new directory, reinstall php and made sure I had the correct grpc version. I have no idea what caused the error, but try every recent grpc version (I think there is four) and ensure that in your config file every addition copies the format.
I had a new php install outside of WAMP which worked, but as wamp has it's own that was bugged for me

MongoDB php extension install on ubuntu 12.04: fatal error: Zend/zend_string.h: No such file or directory

I've been trying to install a php 5.6 driver for mongodb on Ubuntu 12.04. (Will be using this on a Zend Framework 1.11 system, yes this is old, I am fully aware).
I've tried a few things, nothing works.
It seems I should get it to work using this installation:
http://php.net/manual/en/mongodb.installation.manual.php
But for some reason at the make all -j 5 step I get the following error:
In file included from /var/mongotest/mongo-php-driver/src/bson.c:29:0:
./phongo_compat.h:21:30: fatal error: Zend/zend_string.h: No such file or directory
compilation terminated.
In file included from /var/mongotest/mongo-php-driver/src/bson-encode.c:29:0:
./phongo_compat.h:21:30: fatal error: Zend/zend_string.h: No such file or directory
Just install php5.6-dev, it includes all the header files.

Symlink for libxml2 not working after installing and configuring

I am currently have two PHP version in my server ;
PHP version 5.2.11 - the current version of the php in the server
wherein many programs uses it. Have libxml2-2.6.16 as libxml2 version.
Virtually Installed PHP
PHP version 5.4.44 - the virtually installed version of php in the server. Since, I upload my project in the server which uses Symfony
Framework. As symfony requirement, php version must be at least have
a php version of 5.3. And so, we installed this PHP version virtually.
After setting all the necessary configuration, we run it in the browser using its customize port. Unfortunately,the page gives this error.
Fatal error: Uncaught exception 'InvalidArgumentException' with message '[ERROR 3070] CT 'container': The content model is not determinist. (in file:////home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 20, column 0)' in /home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:96 Stack trace: #0 /home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(218): Symfony\Component\Config\Util\XmlUtils::loadFile('/home/sanchez/...', Array) #1 /home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(41): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM('/home/sanchez/...') #2 /home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php(48): Symfony\Component\DependencyInjection\Loader\XmlFileLo in /home/sanchez/ProjectName/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php on line 220
To understand more about the error, I research in the internet and find some related topics that may help. Then,, I found out that it is all about the libxml2, so I installed another libxml2 version in my directory (personal) and just use symlink for it to point to my directory. By the way I install, libxml2-2.8.0 as libxml2 version. I am also using RHEL4.After setting again the neccessary configuration , it still give the same error as above.
How can I solve this? Is it really possible to have two libxml2 version on the server? Do I miss any configuration or something? Is my libxml2 version and php version 5.4.44 is compatible? Or there is any libxml2 that is compatible with my php version? What should I do?
Appreciate any help.Thanks.

PHP Issue with PHAR and ZLIB

I'm trying to install phpbrew on my system.
Ubuntu Server Raring Ringtail 13.04 x64
I downloaded the file from GitHub
It has all permissions set, but everytime i try to decompress and install the phar file it throws me this error:
kkoci#ubuntuweb:~/phpbrew$ php -c /etc/php5/cli/php.ini phpbrew
PHP Fatal error: Uncaught exception 'PharException' with message 'zlib extension is required for gz compressed .phar file "/home/kkoci/phpbrew/phpbrew"' in /home/kkoci/phpbrew/phpbrew:3
Stack trace:
#0 /home/kkoci/phpbrew/phpbrew(3): Phar::mapPhar('phpbrew.phar')
#1 {main}
thrown in /home/kkoci/phpbrew/phpbrew on line 3
zlib extension is already enabled, on web version (apache) of php and on cli as well.
These are the interesting lines of the phpbrew phar
#!/usr/bin/env php
<?php
Phar::mapPhar('phpbrew.phar');require 'phar://phpbrew.phar/Universal/ClassLoader/SplClassLoader.php';
$classLoader = new \Universal\ClassLoader\SplClassLoader;
$classLoader->addFallback( 'phar://phpbrew.phar' );
$classLoader->register();require 'phar://phpbrew.phar/scripts/phpbrew- emb.php';__HALT_COMPILER(); ?>
Please, i can't figure out how to bypass this, as i wrote before, everything is enabled, zlib and phar, i don't know, maybe i'm missing some phar configuration?
Same problem, fixed it doing a configure --with-zlib --with-zlib-dir=/ext/zlib
and then a make install

Weird error when running phpUnit test suite from Zend Studio 8

Zend Studio 8 has phpUnit integration and a dedicated view, which is great, so I would like to use it... but:
When I run my phpunit.xml on the command line, the tests are executed just fine, when I try to run phpunit.xml in Zend Studio as unit test, I get the following fatal error:
Fatal error: Uncaught exception
'PHPUnit_Framework_Error' with message
'Assigning the return value of new by
reference is deprecated' in C:\Program
Files
(x86)\Zend\ZendServer\bin\PEAR\PEAR\Config.php:650
Stack trace:
#0 C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\PEAR\RunTest.php(22):
ZendPHPUnitErrorHandler->handle(8192,
'Assigning the r...', 'C:\Program
File...', 650, Array)
#1 C:\Program
Files
(x86)\Zend\ZendServer\bin\PEAR\PEAR\RunTest.php(22):
require_once()
#2 C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\PHPUnit\Extensions\PhptTestCase.php(49):
require_once('C:\Program File...')
#3
C:\Program Files (x86)\Zend\Zend
Studio -
8.0.0\plugins\com.zend.php.phpunit_8.0.0.v20101001-0100\resources\ZendPHPUnit.php(103):
require_once('C:\Program File...')
#4
{main} thrown in C:\Program Files
(x86)\Zend\ZendServer\bin\PEAR\PEAR\Config.php
on line 650
I really don't have a clue what that means... why should some deprecated code in the PEAR config keep my tests from running?
[edit]
Some additional information:
My colleague who has neither PEAR nor phpunit installed, can run unit tests from Zend Studio 8 just fine but he can't run any from the CLI. So it seems that Zend Studio not only integrates with phpUnit but comes bundled with a version of it. I wanted the newest version and that's why I installed PEAR and then via PEAR I installed phpUnit. As a consequence, the phpUnit library of Zend Studio was outdated and I had to replace the file 'ZendPHPUnit.php' in the Zend Studio plugin folder with a version of a Zend Forum user. This lead to correct inclusion of the phpUnit classes and the current problem.
[/edit]
Line 650 in PEAR\Config.php does
$this->_registry['default'] = &new PEAR_Registry(
$this->configuration['default']['php_dir']
);
This will raise an E_DEPRECATED message depending on whether you have enabled error_reporting to include that level. The error handlers of PHPUnit and ZendPHPUnit will convert those to PHPUnit_Framework_Exceptions.
Because PHP will raise E_DEPRECATED already at compile time, the only way to suppress these errors is in php.ini. My assumption is, that your PHPUnit you run from CLI is using a different php.ini than that your Zend Studio and in that php.ini the error level is not low enough to raise E_DEPRECATED.
If you can provide a reproducable example, we might be able to make more sense of it. In any case, try to update your PEAR installation to the latest version.

Categories