failed to open stream: No such file or directory in /usr/bin/phpunit - zend-framework

while trying to do Unit Testing with Zend Framework I executed the command
sudo phpunit --configuration phpunit.xml
and got this error
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38

Sounds like your install of phpunit did not contain all the dependent packages, like PHP_CodeCoverage.
Perhaps try something like:
sudo pear install --alldeps phpunit/PHPUnit
More details at PHPUnit installation page of the docs.

Maybe your pear is too old.
See if the following tip can solve the issue:
http://www.giocc.com/installing-phpunit-on-ubuntu-11-04-natty-narwhal.html

Related

Error after creating fresh install of AC using Docker for Windows method- a line 17 error

This error happens when starting Step 2) Compile AzerothCore of the Docker install method while on Win10
$ ./acore.sh docker build
Deno version check:
/e/azerothcore-wotlk/apps/bash_shared/deno.sh: line 17: ./deps/deno/bin/deno: cannot execute binary file: Exec format error
Installing Deno...
######################################################################## 100.0%######################################################################### 100.0%
Archive: /e/azerothcore-wotlk/deps/deno/bin/deno.zip
inflating: /e/azerothcore-wotlk/deps/deno/bin/deno.exe
Deno was installed successfully to /e/azerothcore-wotlk/deps/deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
export DENO_INSTALL="/e/azerothcore-wotlk/deps/deno"
export PATH="$DENO_INSTALL/bin:$PATH"
Run '/e/azerothcore-wotlk/deps/deno/bin/deno --help' to get started
/e/azerothcore-wotlk/apps/bash_shared/deno.sh: line 17: ./deps/deno/bin/deno: cannot execute binary file: Exec format error
This errors happens when you have both the linux and the windows deno executables under the deps/deno/bin directory. You can fix it by just using latest AC commit and removing the deno executable file from that directory.
However, this PR should fix the issue: https://github.com/azerothcore/azerothcore-wotlk/pull/5406/files

httpd-2.4.9 rpm build error File not found mod_session_crypto.so,mod_mpm_event.so

I am trying to build an RPM for httpd-2.4.9 in CentOS 6 final 64 bit using command
-tb httpd-2.4.x.tar.bz2. But I am getting following file not found error:
RPM build errors:
File not found: /root/rpmbuild/BUILDROOT/httpd-2.4.9-1.x86_64/usr/lib64/httpd/modules/mod_mpm_event.so
File not found: /root/rpmbuild/BUILDROOT/httpd-2.4.9-1.x86_64/usr/lib64/httpd/modules/mod_session_crypto.so
Can any one help me sort out this issue?
I resolved this by installing the latest APR and APR Utility (http://apr.apache.org/) from source instead of pulling from yum and then installing httpd.
You may also need to change a line in the .spec file for the APR Utility if the crypto library will not install. The blog post at http://ramblin-dude.blogspot.com/2013/04/compiling-rpm-for-httpd-on-rhel-57.html explains that you need to change the line that reads make check || exit 1 to make check || continue for it to compile correctly. I'm not sure if this is relevant in CentOS 6 but in my system with CentOS 5 I had to do this.

Fatal error: Interface 'Zend\Mvc\ApplicationInterface' not found in C:\xampp\htdocs\book_sel\library\Zend\Mvc\Application.php on line 51

I am using zend framework 2 with xampp server for php but while running my index file I get the error as follows:
Fatal error: Interface 'Zend\Mvc\ApplicationInterface' not found in
C:\xampp\htdocs\book_sel\library\Zend\Mvc\Application.php on line 51
Please help me with it.
It's definitely best to install the application using composer as outlined here:
https://github.com/zendframework/ZendSkeletonApplication
this will take care of any autoloading issues for you.
an example:
cd my/project/dir
git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
php composer.phar install

Mac osx Lion phpunit require(/usr/lib/php/PHPUnit/Autoload.php)

I am migrating to a new computer moving from snow leopard to lion at the same time. phpunit did not seem to make the migration, so I have reinstalled it. However the standard install with pear seems to not work with my home brew install of php. Here is the error:
phpunit
PHP Warning: require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43
Warning: require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43
PHP Fatal error: require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/bimemployee/pear/share/pear:/usr/lib/php') in /usr/bin/phpunit on line 43
Fatal error: require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/bimemployee/pear/share/pear:/usr/lib/php') in /usr/bin/phpunit on line 43
I have my computer setup with my main /etc/php.ini file as a symlink to the home brew php.ini file at /usr/local/etc/php.ini this contains my include path which seems to be working.
php -r 'foreach (explode(":", get_include_path()) as $path) echo $path . PHP_EOL;'
No log handling enabled - turning on stderr logging
Cannot find module (LM-SENSORS-MIB): At line 0 in (none)
.
/Users/bimemployee/pear/share/pear
/usr/lib/php
I am also setting up php to work with the homebrew version via the .bash_profile file.
export PATH="$(brew --prefix)/bin:$PATH"
which php
/usr/local/bin/php
which phpunit
/usr/bin/phpunit
Thanks for any help.
-Cory
Maybe you don't have the latest version or the full phpunit installation. You need to install all dependencies using --alldeps
So you should install phpunit like this:
pear channel-discover pear.symfony.com # for Yaml dependency
pear channel-discover pear.phpunit.de
pear install --alldeps phpunit/PHPUnit
This work for me ;)
The problem you having might be connected with your include_path, actual (real) php lib directory and with brew link command.
Brew installs php lib into Cellar directory and than links (brew link) all existing resources to /usr/local/lib/php (or /usr/lib/php - depending on your installation).
The problem is File.php and File/ appears in Cellar php lib after linking process (probably after pear update/upgrade). That means it will be not linked in /usr/local/lib/php.
To fix it you can simply brew unlink and brew link again.
Additionally it would be good to set your pear php_dir to /usr/local/lib/php. This way all new pear modules will be installed in correct destination without linking process. This makes nice separation between custom Pear modules and PHP lib itself.
You need to set your php include path in php.ini so that it includes the PEAR directory where PHPUnit lives.
include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php:"
You may need to search for Autoload.php using spotlight to find the right location.

Zend-framework Error while trying ZF create project

when i was trying ZF create project test. I got this error message.
Pls help me to correct this.
PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/share/php/PHPUnit/Autoload.php on line 64
Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/share/php/PHPUnit/Autoload.php on line 64
from PHP Unit Installation instructions :
PHP_CodeCoverage, the library that is used by PHPUnit 3.5 to collect
and process code coverage information, depends on Xdebug 2.0.5 (or
later) but Xdebug 2.1.2 (or later) is highly recommended.
So you need to install it using PEAR , so either install PEAR or update your existing pear installation and do these commands to install PHP_CodeCoverage
pear config-set auto_discover 1
pear install pear.phpunit.de/PHP_CodeCoverage