I am trying to use Visual PHPUnit https://github.com/NSinopoli/VisualPHPUnit/
My OS is OSX version 10.8.5.
I installed pear .It works well. I checked following the http://pear.php.net/manual/en/installation.checking.php#installation.checking.cli.phpdir
I installed phpunit via pear.
When I run I got the error
( ! ) Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /Users/myname/Sites/VisualPHPUnit/app/config/bootstrap.php on line 83
( ! ) Fatal error: require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:/usr/share/pear/share/pear:/Users/myname/pear/share/pear:/usr/local/pear/share/pear:/Users/myname/Sites/VisualPHPUnit:/usr/local/pear/share') in /Users/myname/Sites/VisualPHPUnit/app/config/bootstrap.php on line 83
So is PHPUnit folder supposed to be under pear path or in my project path?
And is my phpunit installation problem?Any one help me?
To see where pear installed phpunit do
$ pear list phpunit/phpunit
Related
This is my configuration for pear and I will get this error while I'm executing php doc command. Im on Mac OS Sierra and my php -v is PHP 5.6.30 (cli) (built: Feb 7 2017 16:18:37)
phpdoc --filename first-doc.php -t docs
PHP Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /usr/local/bin/phpdoc on line 40
PHP Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:') in /usr/local/bin/phpdoc on line 40
Please help
At a minimum, your PHP configuration's include_path does not contain the main PEAR php_dir location.
Note the error message shows (include_path='.:'), meaning it only contains your current directory you're in right now in the shell.
Your PEAR config shows that php_dir is set to /usr/lib/php, so that needs to be added to the include_path setting in your php.ini file.
I'm actually surprised that PEAR would install anything successfully without the include_path set correctly, as the PEAR program itself should be having trouble running itself. Perhaps the include_path was misconfigured after things were installed.
Cakephp is my first PHP framework. I followed the instructions in Documentation / install. It seems everything was correct, but when i tried to run, i get errors:
Warning: require(/var/www/html/caketest/vendor/autoload.php): failed
to open stream: No such file or directory in
/var/www/html/caketest/config/bootstrap.php on line 23
Fatal error: require(): Failed opening required
'/var/www/html/caketest/vendor/autoload.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/html/caketest/config/bootstrap.php on line 23
im using ubuntu with php 5.5.9, pear is installed
I tried to find the solution but without sucsess.
How to correct these errors?
I found out that there was a missing package in my system. - php5-intl
It was written in official CakePHP install manual, and i checked it but looks like not well.
Install manual for php5-intl
http://php.net/manual/en/intl.setup.php
ps: restart apache after instalation
sudo /etc/init.d/apache2 restart
I install aws sdk for php in my elastic beanstalk application using phar file,:
require_once __DIR__ . '/../AWS-SDK/aws.phar';
when I run the script for the first time, it succeed ! but when I try again I got this error :
Warning: require(phar://aws.phar/aws-autoloader.php): failed to open stream: phar error: invalid url or non-existent phar "phar://aws.phar/aws-autoloader.php" in /var/app/current/src/utils/AWS-SDK/aws.phar on line 3 Fatal error: require(): Failed opening required 'phar://aws.phar/aws-autoloader.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/app/current/src/utils/AWS-SDK/aws.phar on line 3
How to solve the problem ?
Don't use require_once. That's causing that issue. You should use require or include
There seems to be an error on some versions of the aws.phar file that causes this behavior and warning message.
Warning: require(phar://aws.phar/aws-autoloader.php): failed to open stream: phar error: invalid url or non-existent phar "phar://aws.phar/aws-autoloader.php" in /var/app/current/src/utils/AWS-SDK/aws.phar on line 3 Fatal error: require(): Failed opening required 'phar://aws.phar/aws-autoloader.php' (include_path='.:/usr/share/pear:/usr/share/php')
I was experimenting the same issue using aws.phar with version 2.7.17 of the AWS SDK for PHP
The solution that worked for me was to download and extract the aws.zip version of the AWS SDK for PHP and require aws-autoloader.php instead as described in the installation docs.
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html#installing-via-zip
Some people reports success when using the 2.4.10 version of the AWS (aws.phar) but that is too old for my purposes.
https://pyd.io/f/topic/pydio-6-0-s3-plugin-phar-error/
Try turning off opcache
add the following to /etc/php5/apache2/php.ini opcache.enable=0
restart apache service apache2 restart
This is a know issue at least with older versions of the aws.phar and there seems to be a general issue with phars and opc (formerly Zend Optimizer+)
to solve the problem I'v installed the sdk using composer ! BTW it's the recommended technique !
Make sure you declare all namespace usage at the top of the file before you do "require". If you include files first, it can mess up the namespacing. This fixed the issue for me.
daloRadius is an open source and free software based on php, i downloaded it and trying to run it in waamp server, after the login page i am getting this error
include_once(DB.php): failed to open stream: No such file or directory in C:\wamp\www\daloradius-0.9-9\library\opendb.php
I have searched thoroughly the db.php file but couldnt find it in the folder, what should I do? Do Ii have to create the file?
I was working on a ubuntu 14 based freeradius setup and daloradius as web interface, encountered the same issue.
PHP Warning: include_once(DB.php): failed to open stream: No such
file or directory in /var/www/html/daloradius/library/opendb.php on
line 84
Installing php-db worked for me:
sudo apt-get install php-db
You are missing the PHP Pear DB library. Install the library via pear install DB
I've a problem with PEAR (PHP). This is the error:
Warning: require_once(DB.php): failed to open stream: No such file or directory in /WWW/xxx.php on line 2
Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.:/usr/share/php:/usr/share/pear') in /WWW/xxx.php on line 2
I've already installed PEAR (version 1.9.0)
In my PHP file the first two lines are these:
1- <?php
2- require_once('DB.php');
Where's the problem?
Thank you all!
You need to install the module:
pear install DB
Although this page gives a warning about this package being superseded (not deprecated) by MDB2.
You can also install module without using pear:
With Fedora/CentOS:
yum install php-pear-DB
With Debian/Ubuntu:
apt-get install php-db
--
Dario