Jump to content

PHP on new server no longer connects (MSSQL)


Moron

Recommended Posts

You are likely getting a fatal runtime error (undefined sqlsrv_connect function call.)

 

PLEASE check and show us what the phpinfo() output shows for the error_reporting and display_errors settings.

 

By making the first <? opening tag a short one, your connection logic is not seen as being php code (if you do a 'view source' of the partially working page, you should see the short opening tag, the two lines of raw php code, and the first closing ?> tag. When you use a full <?php tag, those two lines of code are being executed and execution probably halts at that point, which is why you need to have and confirm (through testing if needed) that php's error_reporting is set to E_ALL and display_errors is set to ON.

 

Another thought just occurred. You likely have output_buffering turned ON in your master php.ini and your header() redirects on the page are discarding any php output error messages. If output_buffering is turned on, you should turn it OFF ASAP (stop and restart your server to get any changes made to your master php.ini to take effect and confirm that the setting actually changed by using a phpinfo() statement.)

Link to comment
Share on other sites

You are likely getting a fatal runtime error (undefined sqlsrv_connect function call.)

 

PLEASE check and show us what the phpinfo() output shows for the error_reporting and display_errors settings.

 

By making the first <? opening tag a short one, your connection logic is not seen as being php code (if you do a 'view source' of the partially working page, you should see the short opening tag, the two lines of raw php code, and the first closing ?> tag. When you use a full <?php tag, those two lines of code are being executed and execution probably halts at that point, which is why you need to have and confirm (through testing if needed) that php's error_reporting is set to E_ALL and display_errors is set to ON.

 

Another thought just occurred. You likely have output_buffering turned ON in your master php.ini and your header() redirects on the page are discarding any php output error messages. If output_buffering is turned on, you should turn it OFF ASAP (stop and restart your server to get any changes made to your master php.ini to take effect and confirm that the setting actually changed by using a phpinfo() statement.)

 

Just wanted to let you know that I'm still here. I had a family emergency earlier in the week and finally got to revisit this yesterday.

 

There are two php.ini files on this server (2008 R2, IIS 7.0); one in C:\Windows and one in C:\Program Files (x86)\PHP\v5.3\php.ini. I made your recommended changes to BOTH because I'm still confused between "Configuration File (php.ini) Path," which points to C:\Windows, and "Loaded Configuration File," which points to C:\Program Files (x86)\PHP\v5.3\php.ini. As in, which is the "real" one?

 

Anyway, after making your recommended changes to BOTH php.ini files, I not only stopped and restarted the website through Internet Services Manager, I also stopped and restarted the World Wide Web Publishing Service. Still, phpinfo() shows exactly ZERO changes; error_reporting is still set to "22527" and display_errors is still set to "Off," pretty as you please.

 

So until I can figure out what this boneheaded crap is, I can't implement your suggestions. And quite frankly, this is making me feel like a total idiot.

 

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.