Page 1 of 1

Include not working...

Posted: Sun Jul 14, 2002 8:47 am
by Dale
OK on my site i have a new type of news thing and its in a directory called forums. Now i put this on my main page:

<? include ("/usr/local/etc/httpd/dale.unrealism.com/forums/PluhNews.php"); ?>

but is that wrong? Cuz then when i view the page its blank.

Posted: Sun Jul 14, 2002 9:08 am
by salto
Dale, I am not sure, what do you mean by your 'main page'?
If it is your web page, you should make the path relative to your html doc, something like

Code: Select all

<?php include '/forums/PluhNews.php'; ?>
and leave out the (), but I might be wrong since I don't know what you try to accomplish.

Posted: Sun Jul 14, 2002 9:15 am
by Dale
Warning: Failed opening '/forums/PluhNews.php' for inclusion (include_path='') in /usr/local/etc/httpd/dale.unrealism.com/index.php on line 94

And on line 94 is <?php include '/forums/PluhNews.php'; ?>

Posted: Sun Jul 14, 2002 9:53 am
by martin
I've tried opening
http://www.imahosting.com/dale/forums/PluhNews.php
and there seems to be no page there!
What is the actual url of the forum?

Posted: Sun Jul 14, 2002 10:33 am
by Dale
Martin if you look in the INCLUDE PATH error..:

/usr/local/etc/httpd/dale.unrealism.com/index.php

I know its not obvious but the url to my forum is:
http://dale.unrealism.com/forums/

My Main Page:
http://dale.unrealism.com

Posted: Sun Jul 14, 2002 11:41 am
by salto
Tell me is there still a problem, the forum is up and riunning on your site as far as I can see. If not: did you try modifications on

Code: Select all

<?php include '/forums/PluhNews.php'; ?>
like

Code: Select all

<?php include './forums/PluhNews.php'; ?>
or

Code: Select all

<?php include 'forums/PluhNews.php'; ?>
what type server is it running on?

Posted: Sun Jul 14, 2002 11:45 am
by fatalcure
yea, this should work:

<?php include("forums/PluhNews.php"); ?>

Posted: Sun Jul 14, 2002 1:24 pm
by Dale
salto
1:
Warning: Failed opening '/forums/PluhNews.php' for inclusion (include_path='') in /usr/local/etc/httpd/dale.unrealism.com/index.php on line 94

2:
BLANK

3:
BLANK

fatalcure
1:
BLANK

Posted: Sun Jul 14, 2002 2:55 pm
by salto
Not much help, aren't we ?;-)
Ok, I don't have the answer but
1) Did you check the include path in your PHP info

Code: Select all

<?php phpinfo(); ?>
Does it point to the proper drive/directory or is there some weird reference which should be corrected. You can correct this in the php.ini
2) once in the directory where you are calling the PHP script, echo the path info

Code: Select all

<?php echo $PATH_INFO; ?>
that should be the proper position from the root of your website dir to the current directory. Copy this path in your include statement.
3) copy the script to the directory where you need it. In some settings the php file should be in the the same directory, depends on the configuration and/or sysadministrator.

Posted: Sun Jul 14, 2002 2:58 pm
by octane
What about

Code: Select all

<?php include './PluhNews.php'; ?>
and

Code: Select all

<?php include '../forums/PluhNews.php'; ?>
HTH

Posted: Sun Jul 14, 2002 5:04 pm
by Dale
All Fail....

Heres my PHP INFO page:
http://####################

Posted: Sun Jul 14, 2002 5:49 pm
by salto
Well, the only thing I can think of is you have no rights to the PluhNews.php. If you are on a shared host, contact the sysadm.
By the way: for security reasons it's better not to expose your php.info

Posted: Sun Jul 14, 2002 7:02 pm
by Dale
I've changed my PHP INFO link :)