Nov 22, 2009

Server-friendly Php Scripts

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Server-friendly Php Scripts

arp240
Hi

I'm relativly new to php...
I'm interested in writing server-friendly php scripts and i was wandering in what cases php scripts are harmfull to server i runs on...
i was thinking about issues like:

* Which php functions are expensive from the point of view of server's performance and resources?

* What is considered to be a long array in php context if ,say, each record is 100 bytes long? (100+ element ? a few thousands?)

* Are there some assumptions that php programmer should avoid?
(comes to mind this example:http://il.php.net/register_globals )

* I working on my own little and simple database using b+ trees (index data structure). It is being written with php. The thing that warries me is disk access...
Will it be noticable for server or not dry.gif
For example, to serve forum page with 25 posts it will require ~30 disk access(each one preceded by appropriate seek operation) 25 of these are to read all 25 posts and the rest are for internal houskeeping.
I know that real databases will probably do even more work and take a lot more resources but the difference is that real db can handle the request asynchrounelsy(server can do other things in between) and real db executing much faster than parsing and iterpreting php script)

* I will be glad to hear anything else that i didn't think about...

thanks

 

 

 


Comment/Reply (w/o sign-up)

jipman
It all depends on the server, if you have a good / fast strong server, it processes much faster. You can't give a hard limit of what is much, because that's different for each server.

I don't think you have to worry much, servers today are quite powerfull

Comment/Reply (w/o sign-up)

ChronicLoser
hmm, i guess there are ways that php can be somewhat harmful to the server you run on, but like jipman said, I doubt that a code can mess with the server too much unless it is doing some infinite loop or something. They're pretty high-tech nowadays ^_^

Comment/Reply (w/o sign-up)

coder2000
The only real damage is from improperly permissioned or owned files. Register globals is only available from a server config so you can't turn it on from a script. Most databases cache the most used sql statements. Now I don't know how much that is done with MySQL but they aren't as taxing on a hdd as you might think.

Comment/Reply (w/o sign-up)

arp240
Ok, thanks:)

Comment/Reply (w/o sign-up)

Hercco
Well one thing that people often forgets when dealing with HTML (or whatever) outputting scripts is that which the scripts (program wise) are usually quite simple and with modern machines run very fast, but it's the I/O that is the slow thing.

So instead of doing like a million echo calls, it's faster to group your stuff together and do just few echos.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Server Php Scripts

  1. View Php In Another Server - (5)
  2. Mini Apache Server W/ Php - Grab it right now ... (5)
    Hi,     Those who don't want to go into all the hassle of configuring Apache with PHP -
    here's a quick alternative. Grab MiniApache_PHP from http://213.106.116.50/james/ . It's
    a much downscaled version of the real Apache server but includes the PHP modules too - very little
    headache over installation and you can start hosting your own sites rightaway. Good alternative for
    testing your custom php codes too... This is what the site says about the software: QUOTE
    MiniApache_PHP is a cut-down version of the open-source Apache web server software for W...
  3. Is It Possible To Make Php Scripts Executed Without A Cron? - (2)
    Title says it all really. Just wondering if it's possible in an way? If so could anyone tell
    me?...
  4. How To Reset The Server Variable Php_auth_user - (9)
    Hi, i'm developing a web application which obviously requires a log in/log out script that i
    just implementing but i dont know why the log out script dont work fine. The problem is related
    with the server variable $_SERVER which remains set even when in the log out script i unset it with
    the unset() function. Does someone knows how can i reset or clear the server variable $_SERVER ???
    Best regards, ...
  5. User Authentication Session Handling Problems - Authorization server variables not staying across pages (14)
    This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I
    have been lurking around here at the Asta Host forums with regard to login and user authentication
    scripts and I have got as far as this: - Starting a session - Registering a session variable -
    Using the variable to check if the user is authenticated or not. - Authenticating the user through
    MySQL database - Logging of the user, by setting the session variable to un-authenticated I have
    been able to achive the following things too that I think is not related to this proble...
  6. Using Php With A Mail Server - (2)
    We all know you can use PHP with a web server, but can you use it with a mail server? I've made
    a personal messenger system, and I was thinking about adding additional functionality in the future,
    such as the ability to send mail from it. Then I started thinking, would it be possible to recieve
    mail with it? Say, have a PHP script that checked when a message arrived at the server, and when it
    does, check for something in the message (e.g. "pmsystem-to: admin") that would tell it to send it
    to a certain user, and then have it do the scripts to send a PM. So, is it...
  7. Where Do I Find Some Free Php Scripts For Quiz / Poll? - (3)
    I need to find two pre-existing PHP applications and install them on my site: 1. A quiz-type
    knowledge testing application. 2. A simple poll with a world-readable IP-based voting log. The quiz
    script should provide the option to create questions of the following types: - single-choice (5 or
    more radio buttons) - multiple choice (5 or more checkboxes) - true / false - answer by entering
    free text (case insensitive) and create a test for someone to take, by selecting individual
    questions or categories of questions. Has anyone successfully used these kind of application...
  8. Problem With PHP Scripts Without MySQL - i have problems with scripts (1)
    I've been working on my site, and the first time i tried my hand witha php guestbook script, i
    did good, it worked on my host. but although i successfully installed an "send email" php script,
    but somehow although on the site when i tired out the form, though it says email has been sent,
    i've not received any email at all!!! and i've checked the account that was to specified
    for the email to be sent , i have entered everything right. This are the steps the manual asked me
    to do, QUOTE 1) Open up config.php with a word editor such as notepad. Fill ...
  9. Need Advice On Good Free Blog Scripts - and good ones? (7)
    Anybody know of any free good blog scripts that are easy to install and use, that can also fit
    easily into your website layout? This is really important so if anyone knows can you please help me
    asap... thanks in advanced....
  10. Looking For Upload Scripts That Support Over 150MB - help (3)
    ive heard upload scripts have a upload limit of 2MB, is this true and does anybody have a upload
    script that supports 150mb ... plz let me know thanks bash18...
  11. Saving A Php Generated Image To The Server - Help Needed Please (5)
    I'm trying to create a script that will generate an image and send it back to the browser while
    saving the same image to the server. I'm doing this because the image should be dynamically
    generated but because of the load that would place on a server if the image happened to be requested
    frequently, I've decided to build in a means to serve the static version of the image most of
    the time. What isn't included here is the function that will check the age of the file in cache
    directory and serve the static image if it is less than an hour old. This isn...
  12. Include Directives And Efficancey - Server preformance, response time (4)
    Hello there. Most of my programming experiance has been with compiled languages. However, I am now
    working in PHP. In a compiled languages (or even a client-side scripting language), include
    directive only effect the preformance at compile-time. It has always been my style to make all
    global variables, functions, and data structures available to all source files by including a header
    file that would then in turn include all the project's headers in the correct sequence. Now, as
    I have said, I am working in PHP. The design of my page is that of a program, with the ...
  13. All in 1 server - PHP4,PHP5,ASP.Net (13)
    Hello, I'm hosting my own site web on my computer. I'm using IIS6 with ASP.NET and PHP4
    running on it and I would like to install also PHP5 to try it. Do you think it's possible ?...
  14. [PHP]fsockopen(): Timed_out - fsockopen() on a Irc Server (7)
    I have create a script that open a connection on a irc server like a BnC; when i test it on my local
    machine it's all ok, but here i receive every time Timed_out, and i don't know why, Someone
    can me explaine why? /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />...



Looking for server, friendly, php, scripts

See Also,

*SIMILAR VIDEOS*
Searching Video's for server, friendly, php, scripts
advertisement



Server-friendly Php Scripts

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com