Errors: Fixed!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ScottieRotten
Forum Newbie
Posts: 2
Joined: Sun Nov 24, 2002 9:08 pm

Errors: Fixed!

Post by ScottieRotten »

Ok, here's the deal. I'm not an expert by any means, but I've had PHP working before and can't get it to work with this new server, however, I think I'm competent enough to understand an explanation if someone explains something to me.

Here's my setup: I'm running 2 domains in Apache using Aliases which work perfectly. I can access both domains via a browser perfectly.

Now, here's my problem. I've set up PHP on my server to run as a module and I've configured php.ini pahts and Apache httpd.conf paths and added the correct moduel lines to run PHP. I've created a php page with only this in it:

<html>
<head>Liquid Test</head>
<body>
Here is a PHP test for Liquid
<?phpinfo();?>
</body>
</html>

but everytime I try to access test.php on my server, I get nothing. When I view the Apache Error Log, it says:

[Sun Nov 24 19:38:38 2002] [error] PHP Warning: Failed opening '/apache/htdocs/liquid/test.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

Now, I don't really know why this is happening, but when I view the source, it's not even close to that code. What I see in View Source is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Obviously this is not the page I think it is, but I have NO idea where it's coming from. I've looked through all the directories where I think this page *might* be coming from, and I can't find anything. If I try to access a normal .html file from the site, it shows up perfectly, only when I try to view a .php file does it pull that info from some other page.

I'm running Windows XP with Apache 1.3.27 (I've also tried Apache 2.0.43 with the same results) and PHP 4.2.3 (manual install, not the cgi installer)

Apache is installed at C:\Apache
PHP is installed at C:\PHP4

If anyone has any ideas why my .php files are coming from some foreign place I'd be incredibly greatful if you could explain it to me. Or, if you need more info on my setup, I'd be glad to post anything that could lead to the cause of this problem.

Thank you in advance for any info you may have. I'm trying to be patient, but I've scouring the forums for any relevant info for over 3 days now trying to get this to work, with no avail, and my patience is starting to run thin. :cry:

ScottieRotten
Last edited by ScottieRotten on Tue Nov 26, 2002 2:41 am, edited 1 time in total.
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

The page you are seeing is not a phantom page, but a default blank page. As there are no errors or code to display, PHP automatically outputs this code. Don't worry about! It just means you are not outputting anything.

I don't understand why you are getting an include error if this is the complete test.php page. For phpinfo just try

Code: Select all

&lt;?php
phpinfo();
?&gt;
as the complete page and try it.

For includes, set up an include directory at /apache/htdocs/liquid/include and set-up php.ini to point to the full path (C:\Apache\htdocs\liquid\include). You can then place fragments to include in there. Get this working and you can then play with it to suit your needs.

I also notice you are using short tags <? , php.ini also needs to be set-up to use these.

Hopes this goes some way to helping
ScottieRotten
Forum Newbie
Posts: 2
Joined: Sun Nov 24, 2002 9:08 pm

Post by ScottieRotten »

Thanks f1nutter!

This information was quite useful. Unfotunately I didn't have the opportunity to try what you suggested because I completely deleted Apache/PHP from my system a few hours before you posted.

I redownloaded the newest apache2, as well as the new php4, installed them, modified the configs, and everything worked. I have no idea why or what I did differently, but everything seems fine now.

I'm sure it could have been any number of things: bad config, bad binary, bad xxxxx, but I'm glad it's all working now and that you replied to my email and gave me a reason to give it one more try.

Keep up the awesome work!!!
Post Reply