Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache HTTPD.conf
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mbirkett
n00b
n00b


Joined: 03 Sep 2002
Posts: 45
Location: Newcastle Upon Tyne

PostPosted: Fri Apr 04, 2003 10:04 am    Post subject: Apache HTTPD.conf Reply with quote

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
View user's profile Send private message
dwerg
Tux's lil' helper
Tux's lil' helper


Joined: 30 Sep 2002
Posts: 101
Location: Amsterdam, the Netherlands

PostPosted: Fri Apr 04, 2003 4:22 pm    Post subject: Reply with quote

Why? Why not just use include() or require()?
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Fri Apr 04, 2003 11:31 pm    Post subject: My two pence Reply with quote

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
View user's profile Send private message
dwerg
Tux's lil' helper
Tux's lil' helper


Joined: 30 Sep 2002
Posts: 101
Location: Amsterdam, the Netherlands

PostPosted: Sat Apr 05, 2003 1:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Sat Apr 05, 2003 10:35 pm    Post subject: wrong overhead Reply with quote

When I said overhead I meant the difference between requires and requires_once, i.e. the "once" checking.
Back to top
View user's profile Send private message
dwerg
Tux's lil' helper
Tux's lil' helper


Joined: 30 Sep 2002
Posts: 101
Location: Amsterdam, the Netherlands

PostPosted: Sun Apr 06, 2003 1:38 pm    Post subject: Reply with quote

That's probably 2 bytes of memory and an extra if statement in the php code.
Back to top
View user's profile Send private message
sweede
n00b
n00b


Joined: 02 Jan 2003
Posts: 45

PostPosted: Sun Apr 06, 2003 2:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20583

PostPosted: Sun Apr 06, 2003 5:52 pm    Post subject: Reply with quote

Moved from Portage & Programming.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
mbirkett
n00b
n00b


Joined: 03 Sep 2002
Posts: 45
Location: Newcastle Upon Tyne

PostPosted: Mon Apr 07, 2003 7:15 am    Post subject: Reply with quote

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
View user's profile Send private message
sweede
n00b
n00b


Joined: 02 Jan 2003
Posts: 45

PostPosted: Mon Apr 07, 2003 11:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum