erebus_83 — 2012-11-07T19:58:14-05:00 — #1
I'm getting the current error and I'm not sure how to get to the file.
PHP Warning: include(./core/int.php): failed to open stream: No such file or directory in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/login/index.php on line 2
PHP Warning: include(): Failed opening './core/int.php' for inclusion (include_path='.:/usr/local/lib/php-5.3.13/lib/php') in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/login/index.php on line 2
Here is the file structure:
So if I where to type it out in the browser it would look like the following:
The text inside of the index.php file:
<p>Just a template.</p>
<?php include '../includes/overall/footer.php'; ?>
The text inside the int.php file:
erebus_83 — 2012-11-07T20:05:36-05:00 — #2
I think I might have fixed the issue inside of the int.php file I needed another '.'
erebus_83 — 2012-11-07T20:44:07-05:00 — #3
nope still getting the error
mildfoam — 2012-11-08T00:23:47-05:00 — #4
i think you should remove the
. in the
so there will be like this one
but you must check directory and included file permission.
ralphm — 2012-11-08T00:42:27-05:00 — #5
According to the file structure you've outlined, it should read:
include '<font color='"#FF0000"'>..</font>/core/int.php';
with two dots. But a more reliable way to link to an include—which doesn't depend on where the files are in relation to each other—is this:
<?php include $_SERVER["DOCUMENT_ROOT"] . "/core/int.php"; ?>
... assuming that the /core/ folder is inside your root folder. If not, the path needs to be modified.
john_betong — 2012-11-08T02:51:24-05:00 — #6
Whenever I get a "file not found error" I use the results from getcwd() and then adjust the relative path of the missing file:
echo getcwd(); die;
include './core/int.php'; # adjust path in accordance with the above results.
pompopom — 2012-11-08T03:01:46-05:00 — #7
Start your script with the set_include_path() function => see php manual
Saves you a lot of headaches...
erebus_83 — 2012-11-09T10:32:29-05:00 — #8
ralph.m - you were right I added the extra dot a I think that got it going. I'm no longer getting that error.
I tried the second option and was still stuck. I would have to start it from the sites root folder correct? Will it work even if the file calling for it is not in the root folder it's self?
erebus_83 — 2012-11-09T10:35:44-05:00 — #9
After making the changes I'm now getting this:
PHP Warning: session_start(): open(/var/php_sessions/sess_7c16b0ff14a4b451578b52ed5220ffc9, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/core/int.php on line 2
This is the code:
Not sure why that is an error is am I missing so information for the session to start?
erebus_83 — 2012-11-09T11:30:43-05:00 — #10
Yes it's fixed
ralph.m - thanks for that code "<?php include $SERVER["DOCUMENTROOT"] . "/core/int.php"; ?>" It helped!
ralphm — 2012-11-09T17:25:37-05:00 — #11
Glad you've sorted it.
Yes, links like that work no matter what page there are in, anywhere in the site, which makes them a lot easier to use.
system — 2012-11-10T02:45:04-05:00 — #12
$SERVER["DOCUMENTROOT"] is very useful sometimes. I will write it in my notebook.
erebus_83 — 2012-11-20T18:48:34-05:00 — #13
PHP Warning: session_start(): open(/var/php_sessions/sess_9060220c72b6226265ccfd207f2f42a4, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb/web078/b784/dom.mediacom/public_html/3GHM/core/init.php on line 1
require $_SERVER["DOCUMENT_ROOT"] . "/core/database/connect.php";
require $_SERVER["DOCUMENT_ROOT"] . "/core/function/general.php";
require $_SERVER["DOCUMENT_ROOT"] . "/core/function/users.php";
$errors = array();
erebus_83 — 2012-11-20T18:49:33-05:00 — #14
Is it not storing the session?