lvibar Posted April 23, 2010 Share Posted April 23, 2010 I'm running into a problem converting a project from ASP to PHP. While converting, I'm noticing running any of the pages is ridiculously slower than its ASP counterpart. So I decide to test out one of the simple pages of the project, which basically makes a call to the MSSQL 2000 database, returns a row, and displays it. It's really just mssql_connect --> mssql_select_db --> mssql_query --> mssql_fetch_array --> echo. Thats it. When running it in ASP, it takes less than a second. When running the PHP version, with a couple of the joins removed because they weren't being used, it takes over 5 seconds to fully load. I'm absolutely stumped, and Googling for answers hasn't provided much help. I know PHP is slower in IIS, but not this slow. By the way, I'm running PHP5 on IIS 6, and just in case it might be an issue, output_buffering=4096 in my php.ini. Thanks for any insight you guys can provide. Quote Link to comment Share on other sites More sharing options...
trq Posted April 23, 2010 Share Posted April 23, 2010 How have you installed php? As cgi, fastcgi or asapi? Quote Link to comment Share on other sites More sharing options...
lvibar Posted April 26, 2010 Author Share Posted April 26, 2010 Thanks for the quick reply. I'm not sure, as I didn't do the actual installations. I'm guessing though it's the same as what phpinfo() gives me as Server API value, CGI/FastCGI. Quote Link to comment Share on other sites More sharing options...
trq Posted April 27, 2010 Share Posted April 27, 2010 That could explain it to a degree, though I'm not sure it should make a noticeable difference. ASAPI is always going to be the fastest as it is built into the server itself. ASP executes as an ASAPI filter, PHP however is considered unstable when installed as an ASAPI module because of certain extensions being non-thread-safe. If you know your not going to be using these extensions you could try installing php as an ASAPI module, though my recommendation would be to er on the side of caution. FastCGI is the safe bet. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.