php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46735 freaky errors with FastCGI
Submitted: 2008-12-03 11:01 UTC Modified: 2009-06-19 09:18 UTC
From: louis at steelbytes dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.2.7RC5 OS: win32
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: louis at steelbytes dot com
New email:
PHP Version: OS:

 

 [2008-12-03 11:01 UTC] louis at steelbytes dot com
Description:
------------
I was trying to repro a crash I get when using fastcgi and any script more complex then hello world, and I came across this gem ...

I'm using IIS7 (tried both VistaSP1 and Win2008), with FastCGI and the attached script fails.  but if I shorten the name of the function, then it doesn't fail!!!  freaky.  

important note, it doesn't fail the first time, only the 2nd, so hit refresh a couple of times in your browser.  if I switch to CGI, then it works fine.

what difference could the name of an uncalled function have on php_mysql.dll?  mmm ...

Reproduce code:
---------------
differences versus php.ini-recommended
    extension_dir = "./ext"
    cgi.force_redirect = 0

index.php
    <html><body><?php
	function abcdefghijklmopqrstuv($s) { return $s; }
	if (!extension_loaded('mysql')) @dl('php_mysql.dll');
	if (!extension_loaded('mysql')) die('mysql not loaded');
	$dblink = mysql_connect('localhost','root','root');
    ?></body></html>


Expected result:
----------------
no error or warning

Actual result:
--------------
PHP Warning: mysql_connect() [function.mysql-connect]: Too many open links (0) in C:\hobby\test\index.php on line 7 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-03 11:59 UTC] louis at steelbytes dot com
NTS seems to fix it.  so is it just that TS is buggy? or that FastCGI is not compatible with TS?
 [2008-12-03 12:49 UTC] pajoye@php.net
Can you try a simple phpinfo with the TS version?

However, you should actually use the NTS version as long as you use fastcgi. dl is also not a good thing to use.

May I ask with OS and IIS version you use? out of curiosity :)
 [2008-12-03 13:15 UTC] louis at steelbytes dot com
> However, you should actually use the NTS version as long as you use
fastcgi.

I can't as I also need Zend Optimizer which requires TS.  (note, zend is not installed during these tests).

> dl is also not a good thing to use.

mmm ... with many projects on one server, each requiring a different set of extensions, it seems wrong to load bucket loads of extensions for a trivial script that needs few/none.

it also eases install on different servers by making my app more independant of the php.ini/php-cgi-fcgi.ini which I feel should be reserved for not app specific settings.

> May I ask with OS and IIS version you use? out of curiosity :)

from my orig post

>> I'm using IIS7 (tried both VistaSP1 and Win2008)

also, my vista box is x64, and the win2k8 is x86
 [2008-12-03 13:23 UTC] pajoye@php.net
"I can't as I also need Zend Optimizer which requires TS.  (note, zend is not installed during these tests)."

They have a NTS version. Also I would not use this extension with official php releases. But that's not the cause as it is not loaded :)

"mmm ... with many projects on one server, each requiring a different set of extensions, it seems wrong to load bucket loads of extensions for a trivial script that needs few/none."

You can create more fcgi instances, per application or script. With custom php.ini for each version.:
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/


 [2008-12-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-06-19 09:18 UTC] pajoye@php.net
Not a php issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC