Jump to content

PHP code running much slower than same code in ASP on IIS.


lvibar

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.