Solved

PHP Startup Error

Posted on 2016-10-27
12
34 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
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 108

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 108

Expert Comment

by:Ray Paseur
ID: 41862482
0
 
LVL 26

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
 
LVL 82

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 26

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 26

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 82

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 82

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now