1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

PHP Pages loading slowly

Discussion in 'Plesk for Windows - 8.x and Older' started by eara01, Jul 29, 2005.

  1. eara01

    eara01 Guest

    0
     
    I had a problem. Development for our application was done in PHP on an Apache server.

    We are checking out Plesk for Windows (IIS instead of Apache). PHP pages on the Apache server took less than a second to load and on IIS took anywhere from 2-10 seconds....very annoying. :(

    After two weeks of searching, I finally found the answer on the PHP site here: http://ca.php.net/function.include

    "To avoid painfully SLOW INCLUDES under IIS be sure to set "output_buffering = on" in php.ini. File includes dropped from about 2 seconds to 0 seconds when this was set."

    The PHP.INI file to change is in the server's WINDOWS directory, or in each site if you've made a copy there to customize each site.

    Our scripts use a lot of includes, and the difference is very dramatic (I consider load times dropping from 8 seconds to less than a half-second to be dramatic) :rolleyes:

    It might me, but it seems the control panel is a tad faster now too.

    I don't know if Plesk will over-write the PHP.ini file during an upgrade of Plesk...does anyone know? If so, what folder contains the 'master' PHP.ini file? :)

    Hope this helps someone else out there.
     
  2. botsman

    botsman Guest

    0
     
    As far as I know Plesk doesn't touch php.ini file during upgrade. "Master" file is located in c:\windows folder. Also to speed up the php working try to us one in ISAPI mode.
     
  3. eara01

    eara01 Guest

    0
     
    Thanks. PHP is already being run as ISAPI extension.:)

    Another funny thing, the client's processor was having a huge affect on the load times. The same client would load the same pages from a server that was using Apache, not IIS, and the slowest client was as fast as the fastest client. However, using the Plesk (IIS) server, the slower clients would take up to 15 seconds to load a page, and faster clients less than a second. By slower I mean a 650 MHz dual processor client, and by faster I mean a 3.0 GHz single processor client.

    Now, they all load quickly - client processor doesn't seem to have any more affect than you'd expect.
     
  4. robtbs

    robtbs Guest

    0
     
    is the ISAPI fixed with plesk 7.5.4
    in 7.5.3 the include paths are screwed up and doesnt take relative paths so i have to use the CGI.

    ouput buffering helps speed up my php using cgi a bit though :)
    Thanks
     
  5. eara01

    eara01 Guest

    0
     
    We've had PHP running as ISAPI both in 7.5.3 and 7.5.4. We never experienced relative paths not working. though I can't say for certain we have any relative paths for our includes, I'm pretty sure our includes use absolute paths.
     
  6. robtbs

    robtbs Guest

    0
     
    :) if your using absolute paths you wont have an issue...

    Sometimes people get lazy though like myself and just do...
    PHP:
    include('includes/header.php');
    for example.
    i have too many sites/pages to go through adding a variable for BASE DIR now :(

    Might try upgrade to 7.5.4 anyway later tonight.
    its definitely an issue with plesk though.
    as i also have a freebsd box running Cpanel and another windows one running helm... they have no issues at all with relative paths running under the ISAPI.

    Cheers for reply
     
  7. eara01

    eara01 Guest

    0
     
    Yeah, I decided early on to use absolute paths for includes :). However, I had to change a few things for Plesk (perhaps because of IIS instead of Apache)

    This works on our Plesk/windows server (with IIS):
    PHP:
        include_once($_SERVER["DOCUMENT_ROOT"] . "/includes/logUserInfo.php");
    where this is what we used on windows OR linux servers (running Apache):
    PHP:
    include_once(getenv("DOCUMENT_ROOT") . "/includes/logUserInfo.php");
    If you feel brave, you might be able to do a global find/replace.
     
Loading...