Jump to content

slowfib

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by slowfib

  1. I didn't want to move to 5.3 because one of the Classes I'm using has a Deprecated function in it:

    Assigning the return value of new by reference is now deprecated.

     

    But I bit the bullet, migrated and updated the Class, unfortunately, the issue still remains.

     

    I also tried to upgrade the "MS SQLSRV Drivers For PHP" from 2.0 to 3.0, but no matter what I tried, I couldn't get the PDO driver to load, so I had to rollback to 2.0. phpinfo() would always show "no value" under PDO. While other drivers (mysql, sqlite) would load just fine.

     

    display_errors is on

    display_startup_errors is off

    log_erros is on

    error_reporting is E_ALL

    errro_log is commented out. Correct me if i'm wrong, but if I enable this, I will only get back error 500s, no?

     

    A memory issue honestly sounds like the most likely cause here, but I'm not sure how to even troubleshoot that? Do you have any suggestions on how to deal with this?

    report_memleaks is on if that helps?

    Watching Task Manager when the issue happened, I could definitely see that php-cgi.exe *32 crash.

    I'm also running Windows 2008 64-bit, though I don't think that makes any difference?

     

    I'm thinking I might try to not use PDO and use the straight sqlsrv functions, though I'm not sure if that makes any difference?

     

    I really appreciate your help so far PFMaBiSmAd. Thank you!

  2. Thanks for the Reply PFMaBiSmAd.

     

    Everything is from the same package I downloaded from windows.php.net/download, and I'm using the Microsoft Drivers for PHP for SQL Server for PHP 5.2.

    If it's a mismatch, shouldn't it crash every time?

    I would suspect that the issue is either with the MS SQL Server driver or the MS PDO SQL Server driver, but have no idea how to tell this.

     

    I was using the thread safe version and having the same issue and one thing I read in to is that I should be using the non-thread safe version, so I've switch to that, but the issue remained even after I changed.

     

    I'm considering upgrading to PHP 5.3, but I know I'm going to have to upgrade some classes along the way to do it, so I've held off for now.

     

    Would I be crazy if I set the IIS App pool to recycle every 2 hours? An App Pool recycle always fixes the issue for another 3-4 hours.

     

  3. A specific part of my PHP script crashes randomly and I'm not sure why. The only difference on this page and the rest of the pages, is that I'm doing a PDO SQLSRV call. But 80% of the time there are no issues, and then suddenly IIS7 will just start spitting out the odd 500 error message. If I recycle the app pool, it works fine again for a while.

     

    Here's the error from the NT log:

     

    HTTP Error 500.0 - Internal Server Error

    C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly

    Detailed Error Information

    Module  FastCgiModule

    Notification    ExecuteRequestHandler

    Handler PHP

    Error Code  0x000000ff

    Requested URL  {removed}

    Physical Path  C:\inetpub\index.php

    Logon Method    Anonymous

    Logon User  Anonymous

     

     

    I'm running PHP 5.2.17 non thread safe, on Windows 2008 64-bit with IIS7.

    The IIS App pools is set to allow 32-bit applications, and as far as I can tell, FastCGI is configured properly in IIS and php.ini

     

    Would really appreciate any suggestions people have. Thanks.

     

     

    Windows also generated this crash report:

     

    Version=1

    EventType=APPCRASH

    EventTime=129647371568690873

    ReportType=2

    Consent=1

    ReportIdentifier=360d3929-058c-11e1-8a87-0050569801cd

    IntegratorReportIdentifier=360d3928-058c-11e1-8a87-0050569801cd

    WOW64=1

    Response.type=4

    Sig[0].Name=Application Name

    Sig[0].Value=php-cgi.exe

    Sig[1].Name=Application Version

    Sig[1].Value=5.2.17.17

    Sig[2].Name=Application Timestamp

    Sig[2].Value=4d25fde8

    Sig[3].Name=Fault Module Name

    Sig[3].Value=php5.dll

    Sig[4].Name=Fault Module Version

    Sig[4].Value=5.2.17.17

    Sig[5].Name=Fault Module Timestamp

    Sig[5].Value=4d25fd3b

    Sig[6].Name=Exception Code

    Sig[6].Value=c0000005

    Sig[7].Name=Exception Offset

    Sig[7].Value=00009043

    DynamicSig[1].Name=OS Version

    DynamicSig[1].Value=6.1.7601.2.1.0.272.7

    DynamicSig[2].Name=Locale ID

    DynamicSig[2].Value=1033

    DynamicSig[22].Name=Additional Information 1

    DynamicSig[22].Value=0a9e

    DynamicSig[23].Name=Additional Information 2

    DynamicSig[23].Value=0a9e372d3b4ad19135b953a78882e789

    DynamicSig[24].Name=Additional Information 3

    DynamicSig[24].Value=0a9e

    DynamicSig[25].Name=Additional Information 4

    DynamicSig[25].Value=0a9e372d3b4ad19135b953a78882e789

    UI[2]=C:\PHP\php-cgi.exe

    UI[5]=Check online for a solution (recommended)

    UI[6]=Check for a solution later (recommended)

    UI[7]=Close

    UI[8]=CGI // FastCGI stopped working and was closed

    UI[9]=A problem caused the application to stop working correctly. Windows will notify you if a solution is available.

    UI[10]=&Close

    Loaded\Windows\SysWOW64\Kerberos.DLL

    LoadedModule[60]=C:\Windows\system32\cryptdll.dll

    LoadedModule[61]=C:\Windows\SysWOW64\msv1_0.DLL

    LoadedModule[62]=C:\Windows\system32\ntdsapi.dll

    LoadedModule[63]=C:\Windows\system32\LOGONCLI.DLL

    LoadedModule[64]=C:\Windows\system32\security.dll

    LoadedModule[65]=C:\Windows\SysWOW64\schannel.dll

    LoadedModule[66]=C:\Windows\system32\mswsock.dll

    LoadedModule[67]=C:\Windows\System32\wshtcpip.dll

    LoadedModule[68]=C:\Windows\system32\ncrypt.dll

    LoadedModule[69]=C:\Windows\System32\wship6.dll

    LoadedModule[70]=C:\Windows\system32\DNSAPI.dll

    LoadedModule[71]=C:\Program Files (x86)\Bonjour\mdnsNSP.dll

    LoadedModule[72]=C:\Windows\system32\Iphlpapi.DLL

    LoadedModule[73]=C:\Windows\system32\WINNSI.DLL

    LoadedModule[74]=C:\Windows\system32\rasadhlp.dll

    LoadedModule[75]=C:\Windows\System32\fwpuclnt.dll

    FriendlyEventName=Stopped working

    ConsentKey=APPCRASH

    AppName=CGI // FastCGI

    AppPath=C:\PHP\php-cgi.exe

  4. I've been working on a project where I pull data from one source via an API in PHP.

     

    But now I need to push this data through another API, but the only way to access the API is via JAR files.

     

    Is there anyway I could accomplish this in PHP?

     

     

    Thanks.

  5. Hey phpfreaks,

     

    I've run in to a bit of an issue in order to use the Oracle php_oci8_11g.dll extension.

     

    Issue is that, the extension doesn't load if my windows path has Oracle drivers, so for example this causes a conflict:

    C:\Oracle\product\10.1.0\Client_2\bin;C:\Oracle\product\10.1.0\Client_2\jre\1.4.2\bin\client;C:\Oracle\product\10.1.0\Client_2\jre\1.4.2\bin;C:\PHP\;C:\PHP\instantclient_11_2

     

    But if the path is set to this, then it works perfectly fine:

    C:\PHP\;C:\PHP\instantclient_11_2

     

    So any idea if I can set a variable or parameter in the PHP.ini to use a specific PATH instead?

    Or something else that would accomplish the same without having to change the Windows path every time I start up the web server?

     

    Thanks.

  6. Thanks niwa3836!

     

    It's been a while since I've looked at this problem, but I'm going to try your code and see if it'll help.

     

    Also, do you think you could provide the code for your niwaWriteLog function?

     

    Thank you!

     

  7. I'm importing some text files from my windows servers in to a SQL database, but I'm running in to what I think is some sort of issue with either a special character or something to do with UTF-8, or UTF-16... I haven't dealt with this before, so I'm really not even sure.

     

    I read in the file as such:

    $handler = fopen($file, "r");
    $Data = fread($handler, filesize($file));
    fclose($handler);
    

     

    The text file itself contains the data formatted like this:

     

    Unable to deliver this message because the follow error was encountered: "This message is a delivery status notification that cannot be delivered.".

    The specific error code was 0xC00402C7.

     

    The message sender was <>.

     

    The message was intended for the following recipients.

    OnlineHelp@somedomain.com

     

    If I simply echo out this data:

    echo $Data
    

     

    It'll come out in Firefox like the following. And I can see FF is choosing to view it as Western (ISO-8859-1), but if I choose to use Unicode (UTF-16) then the data displays correctly.

    U�n�a�b�l�e� �t�o� �d�e�l�i�v�e�r� �t�h�i�s� �m�e�s�s�a�g�e� �b�e�c�a�u�s�e� �t�h�e� �f�o�l�l�o�w� �e�r�r�o�r� �w�a�s� �e�n�c�o�u�n�t�e�r�e�d�:� �"�T�h�i�s� �m�e�s�s�a�g�e� �i�s� �a� �d�e�l�i�v�e�r�y� �s�t�a�t�u�s� �n�o�t�i�f�i�c�a�t�i�o�n� �t�h�a�t� �c�a�n�n�o�t� �b�e� �d�e�l�i�v�e�r�e�d�.�"�.� � � � �T�h�e� �s�p�e�c�i�f�i�c� �e�r�r�o�r� �c�o�d�e� �w�a�s� �0�x�C�0�0�4�0�2�C�7�.� � � � � � �T�h�e� �m�e�s�s�a�g�e� �s�e�n�d�e�r� �w�a�s� �<�>�.� � � � � � �T�h�e� �m�e�s�s�a�g�e� �w�a�s� �i�n�t�e�n�d�e�d� �f�o�r� �t�h�e� �f�o�l�l�o�w�i�n�g� �r�e�c�i�p�i�e�n�t�s�.� � � �O�n�l�i�n�e�H�e�l�p�@�E�l�i�t�e�R�a�c�i�n�g�.�c�o�m� � �

     

    And finally, if I try to insert the data in to SQL, the data looks like this:

     

    INSERT INTO Badmail VALUES(

    2

    , '00360053425643112201000000004.BDR'

    , 'U n a b l e  t o  d e l i v e r  t h i s  m e s s a g e  b e c a u s e  t h e  f o l l o w  e r r o r  w a s  e n c o u n t e r e d :  " T h i s  m e s s a g e  i s  a  d e l i v e r y  s t a t u s  n o t i f i c a t i o n  t h a t  c a n n o t  b e  d e l i v e r e d . " .

     

     

     

    T h e  s p e c i f i c  e r r o r  c o d e  w a s  0 x C 0 0 4 0 2 C 7 .

     

     

     

     

     

    T h e  m e s s a g e  s e n d e r  w a s  < > .

     

     

     

     

     

    T h e  m e s s a g e  w a s  i n t e n d e d  f o r  t h e  f o l l o w i n g  r e c i p i e n t s .

     

    O n l i n e H e l p @ S o m e d o m a i n . c o m

     

    '

    , '2010-11-30 07:17:05'

    , GETDATE())

     

     

    So basically, I'm not really sure if I'm supposed to convert the ASCII to UTF-8 or if I just need to do a bunch of str_replace to correct the data before inserting.

    I'd appreciate any feedback or suggestions anyone has.

     

    Thank you.

  8. I've been working on a script on and off for a while to SSH to a Cisco ASA and run some commands, but I haven't had any luck returning data from my commands. I'm able to login to the device just fine, but they either hang after the first command or do nothing.

     

    I've had the best success with the 2nd method. I'm not sure I'm using the stream_set_blocking function correctly. Sometimes I get partial data back but can't run any commands after than, or nothing is returned at all.

     

    Here are 2 methods I've been trying to work with:

     

     

    // With Net_SSH2:
    require("lib/SSH2.php");
    $ssh = new Net_SSH2($ip);
    if (!$ssh->login($username, $password)) {
    exit('Login Failed');
    }
    $vpncmd = "?";
    echo $ssh->exec($vpncmd);
    
    
    // With PHP built in SSH2 library
    $ssh = ssh2_connect($ip, 22);
    if (!ssh2_auth_password($ssh, $username, $password)) {
    exit('Login Failed');
    }
    $vpncmd = "?";
    $stream = ssh2_exec($ssh, $vpncmd) or die("error");
    stream_set_blocking($stream, false);
    $data = "";
    while ($buf = fread($stream, 4096)) {
    $data .= $buf;
    }
    fclose($stream);
    echo $data;
    

     

    From my Google searches, I've seen some suggestions that Cisco's IOS might have some problems after running the first command, or that SSH2 isn't supported very well (I've tried SSH1 too and had the same problem), but never any resolutions to the issue.

     

    If anyone has any suggestions, I'd really appreciate it.

    Or even if there is a way to display debug info on the connection status and could troubleshoot that.

     

    Or if there's even some way I can push all my commands through Putty.exe  :)

     

    Thank you!

  9. Hmmmm... executing the batch file still hangs the browser and Powershell keeps on running in the background.

    But if I execute the batch file inside of windows, Powershell.exe stops running as soon as the batch file is done executing.

     

    I'm wondering if I can pipe an exit in Powershell to exit once it's finished or something...

     

     

    Here's my code now:

    $output = array();
    $filename = "C:\\temp\\powershell.bat";
    $handle = fopen($filename, "w");
    fwrite($handle, "powershell.exe get-service > C:\\Temp\\powershell-output.txt\nexit");
    fclose($handle);
    
    exec("C:\\temp\\powershell.bat");
    unlink($filename);
    $filename = "C:\\Temp\\powershell-output.txt";
    $handle = fopen($filename, "r");
    $contents = fread($handle, filesize($filename));
    fclose($handle);
    unlink($filename);
    print_r($contents);
    

  10. I'm using PHP on a windows box to execute some powershell scripts, my only problem is that the browser hangs on the request.

    The browser will continue to hang until I goto Task Manager and kill Powershell.exe, then my results are returned as expected.

     

    I've tried to execute an "exit" command after executing my Powershell commands, but that doesn't seem to work.

     

     

    Anyone used Powershell before, or have any ideas on how I could handle this otherwise?

     

    Here's my code:

    $output = array();
    exec("powershell get-service", $output);
    print_r($output);
    

     

     

    Thank you!

  11. I'm experiencing this same problem too, andrewdav, did you ever solve this?

     

    My code:

    $output = array();
    exec("powershell get-service", $output);
    exec("exit");
    print_r($output);
    

     

     

    My browser hangs until I goto Task Manager on the machine and kill Powershell.exe, then my results are returned.

  12. So what I'm after is very simple. I'm trying to retrieve this RSS page:

    http://rss.binsearch.net/rss.php?max=50&g=alt.binaries.multimedia

     

    My problem is, when I use PHP to directly pull it, I get the following error:

     

    http://www.binsearch.info/ Due to excessive data traffic usage, using RSS clients that do not support (gzip) compression is no longer allowed! If you integrated any feeds into your own site and need assistence with implementing gzip support, contact us!<p>Regards,<br>Binsearch team Sat, 01 Oct 2005 07:02:27 GMT 86400

     

    I've done plenty of digging on gzip and understand now that web browsers have it built in that if a page is compressing the data, the browser will retrieve it, uncompress it and display normally.

     

     

    Any ideas on how I pull the data correctly with PHP?

     

    Right now, all I'm doing is this:

     

    <?php

    $results = file_get_contents("http://rss.binsearch.net/rss.php?max=50000&g=alt.binaries.multimedia");

    echo $results;

    ?>

     

    Thank you!

×
×
  • 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.