I'm new to testing and I'm doing the test setup with Codeception, PHP, Docker in PhpStorm.
I am having an error when I run my tests. It appears to be something in the phpstorm_helpers container that is created by the IDE at run time.
Follow the error below and my settings.
Fatal error: require_once(): Failed opening required '/usr/src/myapp/vendor/bin/autoload.php' (include_path='.:/usr/local/lib/php') in /opt/.phpstorm_helpers/codeception.php on line 30
Related
I have deployed a Symfony2 application to shared hosting server from local machine. I used a git pull followed by composer install and then i chmoded the app/cache and app/logs permissions to 777.
Each time I run the application I get the following error:
[2016-02-06 18:55:43] request.CRITICAL:
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:
"Compile Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php')" at
/home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultController.php line 5 {"exception":"[object]
(Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile
Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') at /home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultControll
er.php:5)"} []
I managed to fix this by entering full path to autoload.php:
require '/home/tdarlic/public_html/magniblu/users/vendor/autoload.php';
I tried with
../../../vendor/autoload.php
and with
../../vendor/autoload.php
require __DIR__.'../../vendor.autoload.php';
and still cannot figure out how to keep the autoload file link loading correctly on development machine and on the server.
Any ideas how to solve this?
Similar issue can be found on:
Why my autoload.php of composer doesn't work?
I am adding record via browser in redis cache with predis class it added and no error getting.
When executing from PHPUnit I get the next error:
PHPUnit_Framework_Exception: include_once(Predis\ClientInterface.php): failed to open stream: No such file or directory
However same application, same unit test,same configuration works fine in my colleague's machine.
This morning I updated my phpunit version from 3.7.x to 4.0.x.
I usually run PHPUnit with a bootstrap which contains
require('PHPUnit/Framework/Assert/Functions.php');
Since the update, when I try to run my phpunit tests, it fails because of the following error:
Fatal error: require(): Failed opening required 'PHPUnit/Framework/Assert/Functions.php' (include_path='.:/usr/local/lib/php/:/usr/local/share/pear/') on line 6
What can I do to resolve this?
That file changed location. It is now in src/Framework/Assert/Functions.php.
I'm trying to learn zend framework 2 with this phpunit added, but I cannot get it work. I've followed the steps in the official zf2 tutorial (http://framework.zend.com/manual/2.0/en/user-guide/unit-testing.html) and now I'm facing some kind of error message clueless
Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in C:\xampp\php\pear\PHPUnit\Autoload.php on line 64
Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.;\php\zend_framework\library;\php\pear\PEAR') in C:\xampp\php\pear\PHPUnit\Autoload.php on line 64
PS C:\xampp\htdocs\new103\module\Application\test>
Needed to change the php.ini include_path to list of absolute paths, phpunit can be ran now.
There is Neo4J installed on my Ubuntu and I'm running a test code. It's perfectly working when the code runs on terminal such as:
root#ekin-Inspiron-1090:/var/www# php neo.php
home: demolished
name: Arthur Dent
But when it comes to run on browser like localhost/neo.php, it gives fatal error and stops working.
Warning: require(phar://neo4jphp.phar): failed to open stream: operation failed in /var/www/neo.php on line 4 Fatal error: require(): Failed opening required 'phar://neo4jphp.phar' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/neo.php on line 4
I don't think it's really something with Neo4J or its PHP driver. What should be the reason?
edit: by the way, there are two php.ini files; i think one for apache and one for command line. I checked both of them and phar extension paths are the same. Also there are no include_path settings in both of them.
It's an authorization error. Apache runs under its own user, so you need to give apache user to access www folder.