Forum Moderators: coopster

Message Too Old, No Replies

PHP Includes Error

PHP Includes Error

         

evileyez

8:14 pm on Jan 24, 2004 (gmt 0)

10+ Year Member



Hey everyone,
i have a simply problem for you guys..*maybe*..i have a apache 2 server running on winxp w/php4.3
when i try to access a page on my computer with this command
(about <html>)
<?php
if (!$php) {
$php = "php";
}
?>
(in body tag)
<?php
if(!$page) {
include("news/news.php");
} elseif(!@include("$page.$php")) {
include("error.php");
}
?>

when i try to access a page with this command

<A href="main.php?page=eg/eg">

it doesnt work i get an error:

Warning: main(): Failed opening '' for inclusion (include_path='.:C:\PHP\pear') in C:\arcticfusion\main.php on line 73

ive try not using the <?php
if (!$php) {
$php = "php";
}
?> command and i still get the same answer from it..anyne can help wud be great:)

isitreal

10:36 pm on Jan 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does the include command work on a blank page?

If you make a test page called 'test.php', place the include command in it, with the correct path to the include folder, does it include it?

If it doesn't, and you still get this error, you probably need to set the include path in the apache httpd.conf file, that lives in the apache group/apache2/conf/httpd.conf file, bottom of the file:

<VirtualHost 127.0.0.1:80>
ServerName yoursite
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/websites/yoursite"
<Directory "c:/websites/yoursite">
AllowOverride None
</Directory>
php_value include_path ".;c:/yoursite/includes"
DirectoryIndex index.php index.html index.htm
</VirtualHost>

if you haven't done this php doesn't know where to look for the includes

evileyez

2:14 pm on Jan 25, 2004 (gmt 0)

10+ Year Member



thnx:)