View previous topic :: View next topic |
Author |
Message |
mbirkett n00b
Joined: 03 Sep 2002 Posts: 45 Location: Newcastle Upon Tyne
|
Posted: Fri Apr 04, 2003 10:04 am Post subject: Apache HTTPD.conf |
|
|
Hi,
I am looking for some help setting up apache. This may be in the wrong forum, so feel free to move it.
I have go apache working so that it parses PHP pages as well as Server Side Include (SSI) pages. However, i want to be able to parse a .php file for both php and SSI, has anyone managed to get this working before? and, if so any help would be greatly appreciated.
Cheers,
Marc Birkett _________________ I am Thybrush Greepwood, a mighty privet... |
|
Back to top |
|
|
dwerg Tux's lil' helper
Joined: 30 Sep 2002 Posts: 101 Location: Amsterdam, the Netherlands
|
Posted: Fri Apr 04, 2003 4:22 pm Post subject: |
|
|
Why? Why not just use include() or require()? |
|
Back to top |
|
|
d0wn_under Guru
Joined: 13 Mar 2003 Posts: 300 Location: Sheffield, England
|
Posted: Fri Apr 04, 2003 11:31 pm Post subject: My two pence |
|
|
After having problems with includes trying to include files that are already included I started using include_once and requires_once rather than just plane include and requires.
Never got round to looking up how much, if any, extra overhead is there. Anyone any ideas? |
|
Back to top |
|
|
dwerg Tux's lil' helper
Joined: 30 Sep 2002 Posts: 101 Location: Amsterdam, the Netherlands
|
Posted: Sat Apr 05, 2003 1:26 pm Post subject: |
|
|
The require statements are compiler directives and take about as log as opening a file and reading it. The overhead is there, but it's worth it if it improves the structural design of your source. |
|
Back to top |
|
|
d0wn_under Guru
Joined: 13 Mar 2003 Posts: 300 Location: Sheffield, England
|
Posted: Sat Apr 05, 2003 10:35 pm Post subject: wrong overhead |
|
|
When I said overhead I meant the difference between requires and requires_once, i.e. the "once" checking. |
|
Back to top |
|
|
dwerg Tux's lil' helper
Joined: 30 Sep 2002 Posts: 101 Location: Amsterdam, the Netherlands
|
Posted: Sun Apr 06, 2003 1:38 pm Post subject: |
|
|
That's probably 2 bytes of memory and an extra if statement in the php code. |
|
Back to top |
|
|
sweede n00b
Joined: 02 Jan 2003 Posts: 45
|
Posted: Sun Apr 06, 2003 2:11 pm Post subject: |
|
|
Apache currently cannot send a file through two parsing engines. it would first need to send through the SSI|php interpreter, and then through the other one.
I am not sure what SSI calls you want to make, but everyone can be had in PHP pretty simply.
if you are set on doing something like that, you need to look at the phps virtual command
www.php.net/virtual
As for the overhead between include() and include_once(), there is very little. as one poster said, if it improves the structural integrety if your code, then it is needed.
however, i would also suggest in looking in re-ordering your include statements so you dont run into that problem |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20583
|
Posted: Sun Apr 06, 2003 5:52 pm Post subject: |
|
|
Moved from Portage & Programming. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
mbirkett n00b
Joined: 03 Sep 2002 Posts: 45 Location: Newcastle Upon Tyne
|
Posted: Mon Apr 07, 2003 7:15 am Post subject: |
|
|
I was wanting to return the last current date and the last updated date for a page through SSI.
Would it just be a case of creating a new seperate shtml page and then going:
virtual("currDate.shtml");
??
How do you control the layout of the page??
Cheers,
Marc _________________ I am Thybrush Greepwood, a mighty privet... |
|
Back to top |
|
|
sweede n00b
Joined: 02 Jan 2003 Posts: 45
|
Posted: Mon Apr 07, 2003 11:52 am Post subject: |
|
|
Yes,
however, this is something php can easily take care of,
www.php.net/getlastmod
example,
Code: |
echo "Last modified: " . date ("F d Y H:i:s.", getlastmod());
|
be sure to read the notes posted along with that function |
|
Back to top |
|
|
|