Recently I opened my error_log files and noticed that it have several include() related error message. Website have about 1500 daily visitor but this message shows only about 3 times in month for example I may have group of 10 error on 06 Feb then group of 15 error on 20 Feb etc.
Here's example of error text:
[05-Jun-2013 15:57:39] PHP Warning: include() [function.include]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/user33/public_html/example/file3.php on line 6
[05-Jun-2013 15:57:39] PHP Warning: include(http :// www . example . com/file.php) [function.include]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/user33/public_html/example/file3.php on line 6
or
[19-Jul-2013 17:42:17] PHP Warning: include() [function.include]: Failed opening 'http:// www. example. com/ file.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user33/public_html/example/file4.php on line 5
[19-Jul-2013 17:42:17] PHP Warning: include(http: // www. example. com/file.php) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
in /home/user33/public_html/example/file5.php on line 11
P.S. Website don't use any CMS and have simple page that contains mostly HTML code with several PHP includes.
P.S. 2. Does using absolute path in include() may lead to this errors? e.g. I use include("http://www.example.com/file.php") instead of include("../file.php").
What that may be?
Yes, you have an issue because you are using include("http://www.example.com/file.php") instead of include("../file.php") see include docs for more details
Related
I have a created a domain but all the functions and classes of that domain is to be stored on another domain. but i am unable to get the page using include or require method. I am getting the following error:
Warning: include_once() [function.include-once]: Failed to enable crypto in /domain.com/includes/functions.php on line 3 Warning: include_once(https:/other_domain.com/access.php) [function.include-once]: failed to open stream: operation failed in /domain.com/includes/functions.php on line 3 Warning: include_once() [function.include]: Failed opening 'otherdomain.com/access.php' for inclusion (include_path='.:/opt/php52/lib/php') in /domain.com/includes/functions.php on line 3
The crypto error leads me to think this may be an issue with your SSL:
OPENSSL file_get_contents(): Failed to enable crypto
I've been searching and searching for solutions but I still can't figure out why is this happening. I have another project with the same setup but it doesnt give this error. Runs fine in local but throws error like this in scrutinizer
Warning Error: include(PHPUnit/Autoload.php): failed to open stream:
No such file or directory in
[/home/scrutinizer/build/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,
line 162]
2018-01-19 07:45:23 Warning: include(PHPUnit/Autoload.php): failed to
open stream: No such file or directory in
[/home/scrutinizer/build/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,
line 162]
Warning Error: include(): Failed opening 'PHPUnit/Autoload.php' for
inclusion
(include_path='/home/scrutinizer/build:/home/scrutinizer/build/lib:.:/home/scrutinizer/.phpenv/versions/7.1.12/pear:/home/scrutinizer/.phpenv/versions/7.1.12/share/pyrus/.pear/php')
in
[/home/scrutinizer/build/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,
line 162]
2018-01-19 07:45:23 Warning: include(): Failed opening
'PHPUnit/Autoload.php' for inclusion
(include_path='/home/scrutinizer/build:/home/scrutinizer/build/lib:.:/home/scrutinizer/.phpenv/versions/7.1.12/pear:/home/scrutinizer/.phpenv/versions/7.1.12/share/pyrus/.pear/php')
in
[/home/scrutinizer/build/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php,
line 162]
Error: Please install PHPUnit framework v3.7 (http://www.phpunit.de)
#0 /home/scrutinizer/build/lib/Cake/Console/ShellDispatcher.php(218):
As you already said that you didn't experienced any problem with previous setup.
I suggest you please check the absolute path of the script.
/home/scrutinizer/build/lib/Cake/TestSuite
I am talking about this path.
and tell if you have solved out the problem.I can't tell more than this as you have provided the error only.If I need to help you more then you should provide more details.
Good luck
I installed fresh magento 1.9.2.2. While installing and after it instaled, whenever i try my domain url the same error have been coming like shown below.
Warning: include_once(Mage/Core/functions.php): failed to open stream: No such file or directory in /home/website/public_html/app/Mage.php on line 50
Warning: include_once(): Failed opening 'Mage/Core/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/website/php') in /home/website/public_html/app/Mage.php on line 50
Warning: include_once(Varien/Autoload.php): failed to open stream: No such file or directory in /home/website/public_html/app/Mage.php on line 51
Warning: include_once(): Failed opening 'Varien/Autoload.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/website/php') in /home/website/public_html/app/Mage.php on line 51
Fatal error: Class 'Varien_Autoload' not found in /home/website/public_html/app/Mage.php on line 54
So I used
http://xxx.xxx.xxx.xxx [my ip address]/~website/
then in installtion I changed my path to my domain name. Its not working.
Anyone know any solution. Please help me.
I think that your problem caused by the .htaccess file. Try to rename it to test this idea or check rewrite/redirect rules.
After uploading my site to a hosting, it shows the following error:
Warning: include() [function.include]: Failed opening
'/home/u630543546/public_html/mikenpina/application/views/errors/html/error_php.php'
for inclusion (include_path='.:/opt/php-5.3/pear') in
/home/u630543546/public_html/mikenpina/system/core/Exceptions.php on
line 216
Warning: include() [function.include]: Failed opening
'/home/u630543546/public_html/mikenpina/application/views/errors/html/error_php.php'
for inclusion (include_path='.:/opt/php-5.3/pear') in
/home/u630543546/public_html/mikenpina/system/core/Exceptions.php on
line 216
What could be the cause of this? I've been tracing the error since yesterday but can't seem to find it. I used CodeIgniter 2.2.0 and the latest stable bootstrap.
Thanks in advance guys.
I am starting to work on a site that has been up for some time. It is producing the following error messages before I even got started:
Warning: main(includes/main_functions.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 22
Warning: main() [function.include]: Failed opening 'includes/main_functions.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 22
Warning: main(includes/functions/functions_email.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 23
Warning: main() [function.include]: Failed opening 'includes/functions/functions_email.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 23
Fatal error: Call to undefined function: get_includes_file() in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 24
Could it be that the path in the includes\top.php file is incorrect? Or do I need to look for something else?
the top.php file includes the following code:
define('BASE_PATH' , '/--/--/--/--/--/--/'); (I took out the path in this example).
and on the lines 22, 23, 24 it has the following code:
`include("includes/main_functions.php");
include("includes/functions/functions_email.php");
include(get_includes_file("includes/config.php"));`
all the above files are on the server in those directories.
I really need some direction as to why the errors are there and what I can do to fix them.
Thanks for any and all help or suggestions.
The warning is caused by non existing script file or wrong file permissions.
I would recommend you to do some refactoring, replacing the include function with require_once. This way you'll get a fatal E_COMPILE_ERROR level error which is better than a misleading application.
Then you must define your application base path define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR); and use it to reference all other application dependencies (e.g. require_once(DOCROOT.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'main_functions.php');