I've copied php and IIS files to new PC and can't bring it to work. Everytime getting this error:
Fatal error: Unknown: Failed opening required '-' (include_path:.;C:\PHP\includes)
So, what IS THIS -> '-'? My index.php just contain only two strings, it's <?php and phpinfo();
Some problems may occur when you use IIS under WIndows OS due to a misunderstanding of the file paths that contain non-Latin characters . Check the file path for the presence of non-Latin characters . Also try to change the encoding utf8 script - cp1251
For the information of anyone else who encounters this problem, I was attempting to use php 7.1 on Windows 10 and IIS using localhost.
I had only a test page containing a single phpinfo() command, but when I attempt to navigate to this page, I got:
Fatal error: Unknown: Failed opening required '-' (include_path='.;C:\php\pear') in Unknown on line 0
In my case, the handler mapping in iis was mis-configured.
Start IIS and under Double Click Handler mappings.
Select the entry for *.php and click Edit in the actions menu.
Change php.exe to php-cgi.exe as shown below.
You might also like to look at this page which explains things in a bit more detail:
http://php.net/manual/fa/install.windows.iis7.php
Regards.
Chris B.
Related
I'm getting this error when my site is online
[host www.sitename.com] Backend fatal error: PHP Fatal error: require_once() [function.require]: Failed opening required 'admin/config/connection.php' (include_path='.:/opt/cpanel/ea-php53/root/usr/share/pear:/opt/cpanel/ea-php53/root/usr/share/php') in /home/mistrybu/public_html/index.php on line 373\n
The site works well in localhost but when its put online , the dynamic part is not showing.
I changed the php version from php7 to php5 in cpanel. Now the front end is working but the backend is not.
Can someone help me solve this error?
PHP version
Definitely do not go back to PHP5. Keep it to 7. If that means rewriting some of the existing code, so be it, it will make your site more secure and more future proof.
Error Message
Your require_once() method cannot find or access a particular file. This is most probably because:
File missing
The file (connection.php) doesn't exist in the given location (admin/config). Now keep in mind that as the location doesn't start with a /, it's going to be relative to where the require_once() method is being run from.
Since you're running require_once() from:
home/mistrybu/public_html/
it's going to look for the file here:
/home/mistrybu/public_html/admin/config/.
Does that location exist? Does the connection.php reside in the folder?
Folder mismatch
Try adding the following prefix to your path, and see if that makes a difference:
require_once $_SERVER['DOCUMENT_ROOT'].'/admin/config/connection.php';
File errors
Maybe the file exists, but for some reason, gives an error. Try running the following from your command line and see if you get any errors:
php -f admin/config/connection.php
Recently I met a weird error and hope someone can help.
We use LiteSpeed WebServer and Nginx on top, with PHP 7.5 and MySQL 5 (well, WordPress is the framework). It runs well for many days.
Suddenly it goes fatal at this line in different files
include ("class-xxx.php");
The error log says
[02-Oct-2018 13:04:36 UTC] PHP Fatal error: require(): Failed opening required 'dlass-xxx.php' (include_path='.:/opt/cpanel/ea-php72/root/usr/share/pear') in /xxx.php on line N
I double checked the code and see that the file name is declared "class-xxx.php", but somehow the server tries to include "dlass-xxx.php", thus it cannot find the file and trigger fatal error.
Solution? I re-upload the file, it works. But then it goes fatal in another file, at similar lines using include.
I notice that the first character in the file name, for example "c", is read incorrectly and shift 1 byte before (or after), so the file name is correct.
Such as
include "class-xxx.php" is parsed/read as "dclass-xxx.php"
include "page-xxx.php" is parsed"read as "opage-xxx.php"
...
this is very strange. Do anybody know the reason? Is it related to any caching/memory management of LiteSpeed or Nginx or PHP 7. ?
It happens on PHP 7. only because if I switch to PHP 5.6, the error does not happen.
Hope someone can help. Thanks a lot.
I recently asked a question at Can't run PHP after a new installation of XAMPP but now I realise that I was wrongly blaming a new installation of XAMPP. I've now got the same problem on two computers with different versions of XAMPP, so the problem must be somewhere in my coding, but I can't find it.
XAMPP starts up OK with Apache and MySQL. But then running the simplest PHP script...
<?php echo "HELLO"; ?>
produces these error messages...
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'F:/My Documents/OneDrive/Webs/htdocs/phpinfo.php' (include_path='.;C:/xampp/php/pear/PEAR') in Unknown on line 0
That path to PEAR is specified in php.ini and it DOES exist. I can change php.ini to show any include_path and it doesn't matter whether it exists or not, the same error message appears (showing whatever include_path I have put in).
Even phpinfo.php will not run, as shown in the above example, although phpMyAdmin runs OK.
I'm now convinced that my two XAMPP installations on two computers cannot be causing this, but the error messages are not helping me find the problem. I now have to develop code on remote hosts to get around this problem. Can anyone help?
Many thanks!
I am receiving the below warnings/errors. I have a script that has a require() at the beginning of it. I was using the same script with PHP 5.3.3 and it runs fine, but with PHP 5.4.30 and PHP 5.5.14 I am receiving the the below messages. I have checked what have been changed/deprecated/removed before moving the code. I think I have missed some information somewhere. Your help is highly appreciated. This setup is in a Windows 2008 server
Note: In the error message below for some reason the \epo becomes ←epo
Thanks,
Warning: require(c:←po\php\util\alpha.php): failed to open stream: Invalid argument in C:\epo\php\PO\createInfo.php on line 3
Fatal error: require(): Failed opening required 'c:←epo\php\util\alpha.php' (include_path='.;C:\php-5.5.14\pear') in C:\epo\php\PO\createInfo.php on line 3
The answer to this is that you avoid using "\e" in you paths or strings. Since PHP 5.4 more specifically (php-5.4.4) \e, which is code for ESC was implemented and that is what was causing my code to fail. Theoretically, in Widowns it is always better to use \ instead of just a single \ in paths since backslash is known to be used as an escape character. Another was to do it is to use "/" forward slash and you will buy yourself a piece of mind.
For those who are curious The bug was fixed in PHP 5.4.4 [bug #61827]
Cheers,
I have my apache (for windows) htdocs in a folder like c:\anything1\怘怙怚怛\anything2. The problem is that in this case php won't execute any scripts from here and will display an error message like this:
`Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'c:/anything1/怘怙怚怛/anything2/index.php' (include_path='.;C:\php5\pear') in Unknown on line 0
`
If I try to open a html file, it is served by apache, so it seems that the problem appears only with php.
Do you have an idea how to solve this?
I may be wrong but I'd say you can't do it without patching PHP. Apache (or the PHP apache handler) passes PHP a path encoded in UTF-8 and PHP ultimately relies on the ANSI version of FindFirstFile (and you cannot set a UTF-8 codepage).
I suggest you submit a bug report.
i have same problem,
Read more # http://www.oneminuteinfo.com/2011/02/solve-php-failed-to-open-stream-error.html
it may be help you