Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling Zend opcache in PHP v7.1 returns MS-SQL driver errors #667

Closed
headbr opened this issue Jan 20, 2018 · 6 comments
Closed

Enabling Zend opcache in PHP v7.1 returns MS-SQL driver errors #667

headbr opened this issue Jan 20, 2018 · 6 comments

Comments

@headbr
Copy link

headbr commented Jan 20, 2018

Driver version or file name: php_pdo_sqlsrv_71_nts.dll - File version 4.1.8.9607 (32 bit)
SQL Server version: Microsoft SQL Server Express (64-bit) - 13.0.4206.0
Client operating system: Windows Server 2012 64-bit
PHP version: 7.1
Microsoft ODBC Driver version: 13

I'm upgrading an existing website from PHP v5.6 to v7.1. The only changes are the PHP version and the version of the MS-SQL PHP drivers.

Everything works as expected (as per previous site), except when I enable Zend opcache in php.ini. When I enable it, the site returns one of two error messages:

SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Not enough storage is available to process this command. 1
or occasionally
Fatal error: No ODBC error was found [in calling script, sample code below]

try {
$conn = new PDO('sqlsrv:server='.MSSQL_SERVER.'; Database='.MSSQL_DB, MSSQL_USER, MSSQL_PWD);
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
}
catch(Exception $e)
{ die( print_r( $e->getMessage() ) ); }

The existing PHP v5.6 site has Zend opcache enabled and does not return errors. Changing opcache settings in v7.1 has no effect on the errors. If I disable Zend opcache, the errors disappear.

Update Jan 21 2018 - I also tried the RC 5.2.010419 32-bit version of php_pdo_sqlsrv_71_nts.dll, with the same result: driver errors when Zend opcache is enabled.

@lilgreenbird
Copy link
Contributor

hi @headbr, I found some suggestions from Microsoft to deal with this error here.

Can you please try that and let us know if that resolves your issue?
Thanks!

@headbr
Copy link
Author

headbr commented Jan 22, 2018

This is not an O/S issue or memory issue (128GB RAM on the server). The PHP v5.6 site runs on the same server as the PHP v7.1 site. When Zend opcache is enabled on the v5.6 version, there is no driver error. The only difference is the version of PHP and the version of the MS-SQL drivers. This points to an issue between Zend opcache and the drivers. I've already searched extensively for reports of this issue (none found), which is why I'm posting here.

@lilgreenbird
Copy link
Contributor

The error msg came from the underlying ODBC driver, not from PHP. I could see articles from others who got the same error reporting that it's not a memory or space issue either but had success after various solutions. There's actually an official Microsoft article describing how to solve this problem that I've included above, here it is again. Have you tried any or all of the suggestions in the article yet? I also found other answers on [stackoverflow] from others who had the same problem (https://stackoverflow.com/questions/8402472/error-in-iis-sql-server-not-enough-storage-is-available-to-process-this-command) but I would be more inclined to try the Microsoft suggestions first.

@headbr
Copy link
Author

headbr commented Jan 22, 2018

I don't need to try those suggestions, they are irrelevant. The error message came from the ODBC driver only when Zend opcache was enabled in PHP v7.1, not in PHP v5.6. There is nothing wrong with O/S or with IIS; if there was, the error would also present itself when Zend opcache is disabled and with PHP v5.6 running on the same server. The problem may be with Zend opache in PHP v7.1, not with the MSSQL drivers, so perhaps I will post this issue on the PHP bug tracking site.

@yitam
Copy link
Contributor

yitam commented Sep 26, 2018

Closing this issue as we have no problems enabling Zend opcache with the latest drivers with PHP 7.2. We repeated the tests against PHP 7.1 as well. No problem either. FYI, see how opcache is mentioned in issue #434.

@yitam yitam closed this as completed Sep 26, 2018
@blatouchm
Copy link

I have same problem with symfony console and pdo_sqlsrv (from php 7.1 to 7.3).
Working solution: php 7.2.16, sqlsrv drivers 5.3 (extension=php_pdo_sqlsrv_72_ts_x64.dll)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants