Solved

PHP Startup Error

Posted on 2016-10-27
12
325 Views
Last Modified: 2016-10-27
I am having a problem with a recurring PHP startup error message(s).
(Using PHP 7.07 on IIS 8.5 and Codeigniter 3.0)

•      I have set the PHP Error Reporting to Production Machine in the IIS PHP manager
•      I have set display_errors to Off
•      I have set display_startup_errors to 0 (it was set as Off, but that didn’t work so I’m trying the 0)
•      I’ve set the error_reporting Environment variable to ‘production’ in Codeigniter

And I’m still getting errors like the one below. Do you have any experience in this? I’m not sure what else to try. After making all of these changes, I’ve restarted IIS. It’s weird, because I get the error and refresh the page, and then it goes away. Here is the link, http://casweb.memphis.edu/suapp-research/index.php/post/show 

BTW – all of the files in question are in the correct directory

Error is below:

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.0\ext\php_pdo_sqlsrv_7_ts_x64.dll' - The specified module could not be found.

Filename: Unknown

Line Number: 0

Backtrace:

Any help at all is appreciated.
Debra
0
Comment
Question by:Debra Turner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 41862478
It looks like SQL Server is not installed.  IIRC, this is a separate installation, not bundled with PHP.

Also, when you're at this point in the application lifecycle (trying to get an installation to work, before building any applications), it might be helpful to set things up for error logging.  Here are my settings.
display_errors	On	On
display_startup_errors	Off	Off
error_append_string	no value	no value
error_log	error_log	error_log
error_prepend_string	no value	no value
error_reporting	no value	no value
log_errors	On	On
log_errors_max_len	1024	1024

Open in new window

In my code (PHP script files) I usually use something like this:
error_reporting( E_ALL );
ini_set( 'display_errors', TRUE );
ini_set( 'log_errors',     TRUE );

Open in new window

You might want to turn off the display_errors because it may interfere with the way some frameworks operate.
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41862578
"startup errors" do not apply to libraries loaded through extensions.ini

for that you'd have to redirect php's stderr to a log file in the web server which might or not be feasible when using php as a module in IIS, i have no idea.

if it says the file could not be found, it really couldn't. are you sure you don't have multiple configs in IIS, some of them chrooting or proxying to a different server... or a page loading initially in a virtual server and for some reason redirecting differently ( different referral for example ) next time you try.

can you post log extracts of queries w/o the error ?
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41862728
She' trying to load a 'ts' extension when for IIS it should be the 'nts' extension.  And yes it can cause a startup error, I've managed to do that.  The ODBC 13 or 14 driver must also be installed for the 'sqlsrv' driver to come up.  I wrote an article about this back in May:  https://www.experts-exchange.com/articles/28391/PHP-and-Microsoft-SQL-Server.html
0
 

Author Comment

by:Debra Turner
ID: 41862755
Thank you for your help,

I am accessing a SQL database not on the local server - does that matter that it is not installed?

My settings are the same as  Ray Paseur settings. Except for the display_errors - why would i have them on if production server?

display_errors Off Off
display_startup_errors Off Off
error_append_string no value no value
error_prepend_string no value no value
log_errors On On
log_errors_max_len 1024 1024

This is from my PHP_via_FastCFI_errors log

[27-Oct-2016 17:21:40 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.0\ext\php_pdo_sqlsrv_53_ts.dll' - The specified module could not be found.
 in Unknown on line 0
[27-Oct-2016 17:21:40 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.0\ext\php_pdo_sqlsrv_54_ts.dll' - The specified module could not be found.
 in Unknown on line 0
[27-Oct-2016 17:21:40 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\v7.0\ext\php_pdo_sqlsrv_7_ts_x64.dll' - The specified module could not be found.
 in Unknown on line 0

Since it is looking for a pdo dll, would this setting in my phpinfo() output be a problem?

PDO support enabled
PDO drivers  odbc  

Thank you,
debra
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41862757
it can cause a startup error

sure. my point was you can't capture it with "display_startup_error" directives and the likes. these would capture stuff such as using an undefined function, requiring a missing file or multiple declaration on the same function outside of control structures.... but not dll loading errors which occur before "startup" ( of the php script ). thanks for pointing out
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41862763
I am accessing a SQL database not on the local server - does that matter that it is not installed?

the server needs not be installed. the client needs to be. installing the server usually installs the client as well.

--

as far as display error go, my personal thinking is that you should enable them on any server including in production. a blank page is not much better than a parse error in my opinion and is much more difficult to debug when you need to.

i consider reasonable to change the error levels so you don't get notifications on production servers if you esteem your coding guidelines allow you to use undeclared variables and the likes like a great many of us php coders do
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 41862767
The first two extensions are for previous versions of PHP and they will Not load and should be removed from 'php.ini'.  The current version for PHP 7 needs to be the 'php_pdo_sqlsrv_7_nts_x64.dll' version for IIS, not the 'ts' version which is for Apache.
1
 

Author Comment

by:Debra Turner
ID: 41862837
I just re-downloaded the 4.0 drivers from Microsoft (it says it is for PHP 7.0+) - but it still does not include the php_pdo_sqlsrv_53_nts.dll

So I quoted out the extension in .ini to see if that was the problem.

Restarted the server. Now the error is...

 A PHP Error was encountered

Severity: Core Warning

Message: Module 'sqlsrv' already loaded


Any suggestions?
0
 

Author Comment

by:Debra Turner
ID: 41862855
These are the extensions commented out in my php.ini
Is this correct? And could you please tell me how to get the extension=php_pdo_sqlsrv_53_nts.dll driver? That is the only one I do not have.

extension=php_sqlsrv_53_nts.dll  
extension=php_sqlsrv_54_nts.dll  
extension=php_pdo_sqlsrv_53_nts.dll
extension=php_pdo_sqlsrv_54_nts.dll
extension=php_pdo_sqlsrv_7_nts_x64.dll
extension=php_sqlsrv_7_nts_x64.dll

I appreciate your help
debra
0
 

Author Closing Comment

by:Debra Turner
ID: 41862881
Hi Dave Baldwin,
After reading your article (you posted the link) and digging a little deeper into the nts dll files information, I was able to find the right drivers to load and un-comment the right extensions to get rid of the error.
Thank you for your help!
Debra
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41862988
You're welcome.  Glad my article helped someone!
1

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question