У меня возникла эта проблема при использовании Xampp некоторое время.
У меня есть файлы PHP в папке htdocs.
Я использую Apache, MySQL и Filezilla на xampp, и я проверил папки для файла PEAR.php, и мне кажется, что путь в файле php.ini правильный.
Предупреждение: Неизвестно: не удалось открыть поток: Нет такого файла или каталога в Неизвестно в строке 0
I have created a website using mvc framework, but I cant include php files in files that are from another folder. For example, I have model, view, controller and core folders, if I do the following require ‘Core/User.php’ ; in a view file in view folder, then I get the following error:
I’ve tried using ../Core/User.php , but the application becomes too messy and i need a cleaner way of doing this, perhaps working with php.ini or .htaccess to allow me to just include(‘Core/User.php’); from another folder. Any help would be appreciated.

1 Answer 1
There are two ways that I would do this. Both are ways of adding ‘C:xampphtdocsk2’ to your include path
Add this line to you .htaccess file in the web root. You can add other directories as desired
Makse sure Apache is configured to allow htacess to work: Number 4
- If you have some «config» file that is always included, you can add this line to it to set the include path
set_include_path(get_include_path() . PATH_SEPARATOR . ‘C:xampphtdocsk2’);
This makes your code more portable than using relative or absolute path, since there is only one place to make changes when file structures change.
I’m trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.
The website cannot find PEAR, and throws the below errors:
Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:xampplitehtdocslaconicalibcommon.php on line 31
Fatal error: require_once() [function.require]: Failed opening required ‘PEAR.php’ (include_path=’.;xampplitephppearPEAR’) in C:xampplitehtdocslaconicalibcommon.php on line 31
- PEAR is located in C:xampplitephppear
- phpinfo() shows me that the include path is .;xampplitephppear
What am I doing wrong? Why isn’t the PEAR folder being included?

8 Answers 8
You need to fix your include_path system variable to point to the correct location.
To fix it edit the php.ini file. In that file you will find a line that says, » include_path = . «. (You can find out what the location of php.ini by running phpinfo() on a page.) Fix the part of the line that says, » xampplitephppearPEAR » to read » C:xampplitephppear «. Make sure to leave the semi-colons before and/or after the line in place.
Restart PHP and you should be good to go. To restart PHP in IIS you can restart the application pool assigned to your site or, better yet, restart IIS all together.
If you are using the portable XAMPP installation and Windows 7, and, like me have the version after they removed the XAMPP shell from the control panel none of the suggested answers here will do you much good as the packages will not install.
The problem is with the config file. I found the correct settings after a lot of trial and error.
Simply pull up a command window in the xamppphp directory and run
you will want to replace the ‘:’ with the actual drive letter that your portable drive is running on at the moment. Unfortunately, this needs to be done any time this drive letter changes, but it did get the module I needed installed.