Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Question about PHP-enabled servers

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a website that is currently mostly static pages, with only a small percentage actually employing PHP scripting.
For the sake of uniformity, and also to account for the possibility that I may be adding some PHP code to the other pages, I went ahead and gave all my pages .php extensions.
What I'm assuming will happen is that every page that gets requested will be passed onto the PHP parser, which will then notice that there is no scripting on the page and pass it along to the user.
My question is will this have a noticeable impact on the performance/speed of my website. And does this go against good practices.
My current website is composed about roughly two dozen pages and I expect moderate amounts of traffic (hopefully!).
Thanks
Jimmy
SCJP,SCWCD
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am dealing with the same issues as you. 24 pages doesn't really seem like a lot to me. And my initial thought on performance is this:
If you will eventually have everything PHP enabled anyway, does it matter how it performs now?
It can't perform any worse. So I wouldn't worry about it. It may even give you some good inclination as to where some problems may lie in your Web Page without having to deal with a lot of PHP code right off the bat. Not to mention it will help test your Web Server to see if your hosting company is worth a damn.
As far as "good practices" I do not know for sure. But I can't imagine it is bad practise to keep some sort of uniformaty to the Web Site.
My thoughts anyway...
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did some work with PHP last summer. If I remember correctly, the .php files don't get sent anywhere for processing unless the <? ?> tags show up in your page, and then only the tags get processed. I'm about 80% sure on this.
Honestly, I don't know how dynamic PHP can be without implementing a database. MySQL is easy to use and most hosts that provide PHP will also provide MySQL. If you run your own server you're still okay because it's free and fairly simple to set up just like PHP... maybe even easier.
Without the database, you're stuck with functionality that doesn't go much beyond SSI or basic JavaScript. But maybe that's all you were looking to accomplish for your pages.
I don't claim to be an absolute guru at PHP, but if you need some help drop me a line:
marcpeabody@yahoo.com
 
Ranch Hand
Posts: 4714
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i remember correctly, Marc is right about the tag thing. i did the same thing when i set up my servlet site, i let tomcat serve up most of the static pages too(except the first one) i dont think it matters though if there is not a lot of traffic at the site.
[ February 22, 2003: Message edited by: Randall Twede ]
 
Jimmy Blakely
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx for the responses guys.
I'm going to leave all the pages as *.php.
Marc: At the risk of sounding like I'm advertising, I'm currently using Lunarpages and have to say they are awesome. My account is both PHP and JSP enabled. I'm making the main website mainly rely on PHP and am going to implement several web apps in Servlet/JSP.
The website is about 30% done.
However I do have one specific question about PHP. How do you concat strings?
For example: $var = "one" + " " + "two"
This is one of the very few questions I can't seem to answer relying on the net. I'm using a PHP script to auto-mail contact info from an HTML form.
Thanks in advance.
Still in beta: http://www.aegis-consulting.net/tmp/contact.php
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with my very limited knowledge of PHP, i think it is link this
$var = $varone . $vartwo;
 
Jimmy Blakely
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked perfectly,
thanx Eric!
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!