Re: include not working on Linux/Apache server
- From: "Aaron Gray" <ang.usenet@xxxxxxxxx>
- Date: Tue, 4 Mar 2008 02:40:27 -0000
"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> wrote in message news:yfednTWlj7kILFHanZ2dnUVZ_gWdnZ2d@xxxxxxxxxxxxxx
Aaron Gray wrote:Hi,PHP accesses the file system directly, not the web server. You're telling PHP to access /skin/Test.php from the root directory of your system, not your web server.
For some reason incude does not seem to want to work. Its giving the error :-
Warning: include(http://www.***.org/skin/Test.php) [function.include]: failed to open stream: Permission denied in /var/www/***.org/html/skintest.php on line 9
You need to tell PHP where the web root is first, then get your file, i.e.
include ($_SERVER['DOCUMENT_ROOT'] . '/skin/Test.php');
Great, thats it, thanks alot Jerry.
The following code works great now :-
$skinname = "Test";
include ($_SERVER['DOCUMENT_ROOT'] . "/skin/" . $skinname . ".php");
$skin = new $skinname;
$skin->show();
Many thanks again,
Aaron
.
- Follow-Ups:
- Re: include not working on Linux/Apache server
- From: AnrDaemon
- Re: include not working on Linux/Apache server
- References:
- include not working on Linux/Apache server
- From: Aaron Gray
- Re: include not working on Linux/Apache server
- From: Jerry Stuckle
- include not working on Linux/Apache server
- Prev by Date: Re: php array allocation explosion
- Next by Date: Dating Software
- Previous by thread: Re: include not working on Linux/Apache server
- Next by thread: Re: include not working on Linux/Apache server
- Index(es):
Relevant Pages
|