I am having a strange problem. I am trying to include a file in one of my php files that is in my /assets folder. In the php file I have the line require "/opt/docker-substantiator2/app/application/libraries/koolreport/core/autoload.php"; This line is failing and I am getting the error:
A PHP Error was encountered
Severity: Compile Error
Message: require(): Failed opening required '/opt/docker-substantiator2/app/application/libraries/koolreport/core/autoload.php' (include_path='.:/opt/bitnami/php/lib/php')
Filename: assets/MyReport.php
Line Number: 4
I assumed that my phpStorm didn't have the correct permissions to access autoload.php. So then I ran the following from the CLI:
richb201@richb201-XPS-13-9370:/opt/docker-substantiator2/app/application/libraries/koolreport/core$ ls -l /opt/docker-substantiator2/app/application/libraries/koolreport/core/autoload.php
-rwxrwxrwx 1 richb201 richb201 1803 May 19 04:35 /opt/docker-substantiator2/app/application/libraries/koolreport/core/autoload.php
As you can see I (richb201) am the owner and all permissions are available. I have no idea what the include_path comment in the error is about? Any idea why I am getting this error?
PHP does not include just any file; just like the Linux $PATH variable for executable files, PHP maintains an include path. Only files on this path will be included, and attempts to include a file from outside that path generate an error.
Edit your
php.ini
file and change theinclude_path
parameter to what you need, e.g.:Separate paths to directories with the
:
character.