I'm making a website and I have to access the init file which is in the core folder. I'm currently in the includes folder detailsmodal.php file which is being triggered by an onclick event. The path I used
require_once './core/init.php';
is giving errors when i click on the modal:
Warning: require_once(./core/init.php): failed to open stream: No such file or directory in C:\xampp\htdocs\mednew\includes\detailsmodal.php on line 2
Fatal error: require_once(): Failed opening required './core/init.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\mednew\includes\detailsmodal.php on line 2
https://gyazo.com/e17324da3caa48c342255bb4bfd1344d
require_once('../../core/init.php');
I think you got two directories ahead instead of one.
Related
I have created a web chat application and whenever I enter the username and password I created it comes up with this error:
Warning: include(../errors/err.php): failed to open stream: No such file or directory in C:\Users\Win8\Documents\EasyPHP\data\localweb\web chat\chatbox\inc\connection.php on line 10
Warning: include(): Failed opening '../errors/err.php' for inclusion (include_path='.;C:\php\pear') in C:\Users\Win8\Documents\EasyPHP\data\localweb\web chat\chatbox\inc\connection.php on line 10
What does this mean?
It is a warning that there is a missed file which cannot be opened, and it's name is err.php. Maybe you have to create an empty err.php file in C:\Users\Win8\Documents\EasyPHP\data\localweb\web chat\chatbox\errors.
It's telling you that on line 10 of connection.php you are trying to do an <?php include 'err.php'; ?>, but your program cannot find it.
I would check the file structure of err.php and make the appropriate correction.
I am uploading my Wordpress site to a hosting by ftp. It uploads well, but I see the following errors when I try to access the website:
Warning: require_once(/home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/real-estate-search.php): failed to open stream: No such file or directory in /home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/load.php on line 22
Fatal error: require_once(): Failed opening required '/home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/real-estate-search.php' (include_path='.:/usr/local/php5_4/lib/php') in /home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/load.php on line 22
What could be? Any help will be appreciated.
it sounds like there is some part of the link before public HTML (the part before the domain name in the error message) that must be included in your php
There may be a super easy fix to this that I am completely missing. I've looked around Stack Overflow and other answers say that what I am doing now should work.
I am trying to require a config.php so I can get the credentials to a database. I am requiring it via require_once (dirname(__FILE__) . "/../../config.php"); The file that I am referencing the method from (config.php) is located at /internal/CloudShop/login config.php is located at /internal/config.php But, when I load the page, I get this error
Warning: require_once(C:\xampp\htdocs\CloudShop\internal\CloudShop/../../config.php): failed to open stream: No such file or directory in C:\xampp\htdocs\CloudShop\internal\CloudShop\login.php on line 48
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\CloudShop\internal\CloudShop/../../config.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\CloudShop\internal\CloudShop\login.php on line 48
What am I doing wrong?
The script where you execute require_once(...) is in /internal/CloudShop. You are looking for a file that is in /internal. Therefore you need to go only 1 directory above in the hierarchy, not two.
require_once (dirname(__FILE__) . "/../config.php");
will do the trick.
I am building a small PHP system, and I can't open files like CSS Styles, PHP Include function and Images.
I also got some errors:
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Warning: include() [function.include]: Failed opening 'includes/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Built by YYY.YYY
logo // Thats the Logo alt
Fatal error: Call to undefined function getlists() in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 28
Title Actions // Some images alt
Edit: On Windows, It is Ok, but on Linux, It is doing those errors
More edit: Solved
From your error messages, your script appears to be this:
/home/chezki/public_html/XXX.XXX/cp/CMS/index.php
Your are trying to load this file:
includes/functions.php
Since you get this error message:
No such file or directory
... the obvious conclusion is that this file does not exist:
/home/chezki/public_html/XXX.XXX/cp/CMS/includes/functions.php
Feel free to edit your question and provide more details if this is not the case.
Edit: the file must have that precise name. If it's called e.g. Functions.php, it's a different file.
You have permission problems. Your web server cannot read functions.php due to wrong permissions. Adjust permissions with chown and chmod.
I am developing opencart application , i installed in on localhost ,and customize it but now i am trying to upload it to server but it get error
Warning: require_once() [function.require-once]: http:// wrapper is
disabled in the server configuration by allow_url_include=0 in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
Warning:
require_once(http://249development.us/johndhan/telhemboradz/system/startup.php)
[function.require-once]: failed to open stream: no suitable wrapper
could be found in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
Fatal error: require_once() [function.require]: Failed opening
required
'http://249development.us/johndhan/telhemboradz/system/startup.php'
(include_path='.:/usr/local/php5_3/lib/php') in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
You need to use paths for your files not HTTP url's. Open your config.php file and admin/config.php file and change
http://249development.us/
to
/home/content/29/9716229/html/
for all of the paths except for those that start HTTP_ or HTTPS_ in the define's
It seems that you are trying to include a remote file via HTTP. If this is intentionally the case, then you need to enable the http:// wrapper - as suggested by the warning you are getting. If this is not the case, then consider removing the URL http://249development.us/ from the require_once statements.