logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: PHP include function - Apache 2.x under windows
Author
DrZ



Joined: 12 Mar 2007
Posts: 6

PostPosted: Fri 16 Mar '07 4:49    Post subject: PHP include function - Apache 2.x under windows Reply with quote

I have installed PHP% in conjuction with Apache 2.2 under Windows SP2, for off-line testing purposes.

I am trying to switch from SSI include to PHP include, again for off-line testing.

The point where I need help is the path to the included file.

I have a file menu.inc, which resides in the root file. When including in file that already resides in the root file, then
<?php include 'menu.inc'; ?> works (I have tested it )

Now, I am trying to include the same file in a file that does not reside in the root directory, but a sub-sub directory. when I use
<?php include '/menu.inc'; ?>, it does not work.

I seems that it is something to do with relative path.

Any help will be appreciated.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 16 Mar '07 10:49    Post subject: Reply with quote

Code:

include "/some.php";


Hello, there are two options depending on your configuration.
a) PHP tries to include from the doc root e.g. C:\apache\htdocs\some.php
b) PHP tries to include from the drive root e.g. C:\some.php

Consult your error log and turn error displaying on in your php.ini

Code:

error_reporting  =  E_ALL & ~E_NOTICE
display_errors = On
Back to top


Reply to topic   Topic: PHP include function - Apache 2.x under windows View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner