Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: php_snmp.dll crashes apache |
|
Author |
|
WoC
Joined: 26 May 2011 Posts: 2
|
Posted: Thu 26 May '11 23:48 Post subject: php_snmp.dll crashes apache |
|
|
Tonight I decided to upgrade my webserver. I uninstalled the existing Apache 2.2.16 installation via the msi-uninstaller (installer came from apache.org) and I removed the existing PHP 5.2.14 installation.
I checked there was no old php5apache2_2.dll or php5ts.dll on the system left.
I downloaded httpd-2.2.19-win32-x86-ssl.zip from apachelounge.com and php-5.3.6-Win32-VC9-x86.zip from php.net. I followed the installation guide on http://www.apachelounge.com/viewtopic.php?t=2394
Details:
- OS is Windows 7 ultimate 32 bit
- I extracted apache to c:\apps\apache2.2
- I edited httpd.conf for the correct server and htdocs directory's
- apache runs fine from a command window
- I extracted PHP to c:\apps\PHP
- I renamed php.ini-production to php.ini and edited the basics (set the extensions dir to "C:\apps\PHP\ext"). Did not enable any extensions.
- I edited httpd.conf with
Code: | # Load PHP module
LoadModule php5_module "C:/apps/PHP/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "C:/apps/PHP" |
- apache runs fine from a command window. PHP is working, as phpinfo() gives information.
Then I started enabling extensions in php.ini. After restarting httpd.exe, it crashes. I disabled all the extensions and start enabling them one by one. The php_snmp.dll crashes apache (php_zip.dll also crashes apache but that extension is not available in the directory(?)).
I followed the instructions at http://php.net/manual/en/snmp.installation.php and copied the data from c:\apps\php\extra\mibs to c:\usr\mibs and added that to the MIBDIRS variable.
Still, Apache crashes when I start it with php_snmp.dll enabled in php.ini
Does anyone recognize this problem? I want to use snmp. Is there a solution? Or do I have to go back to PHP 5.2? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 27 May '11 10:10 Post subject: |
|
|
in php.ini display_startup_errors = On.
Well I tried it. And php_snmp.dll wants php5.dll which means, that it build against the non thread safe version and not the thread safe version you and I use with php as module. This
if php_zip.dll isn't in that ext folder no wonder apache can't load it in the php module. |
|
Back to top |
|
WoC
Joined: 26 May 2011 Posts: 2
|
Posted: Fri 27 May '11 13:36 Post subject: |
|
|
James Blond wrote: | in php.ini display_startup_errors = On.
Well I tried it. And php_snmp.dll wants php5.dll which means, that it build against the non thread safe version and not the thread safe version you and I use with php as module. This | Ok, thank you. When I enable display_startup_errors I don't see any errors, besides the one stating Apache is crashing.
But there is no other solution, besides running the non-thread-safe version?
Quote: | if php_zip.dll isn't in that ext folder no wonder apache can't load it in the php module. | I figured that one out |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 27 May '11 14:05 Post subject: |
|
|
Hm, I just downloaded the newest thread safe version (5.3.6) before it was 5.3.5 now I don't get a warning, but now apache crashes like yours when I try to load php_snmp.dll.
Now I get something in my apache error log
Quote: |
No log handling enabled - turning on stderr logging
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
|
After setting the MIBDIRS in ENV like you did, apache crashes with nothing in the error log and there is nothing in the windows event log I must say, that I don't see there a solution for using snmp. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 27 May '11 14:16 Post subject: |
|
|
I forgot something important. it works running snmp on php-cgi on the command line. So you can use PHP over mod_fcgid ( you can download it from apache lounge) instead of php module.
Code: |
# Load PHP module
# LoadModule php5_module "C:/apps/PHP/php5apache2_2.dll"
# AddHandler application/x-httpd-php .php
# Configure the path to php.ini
# PHPIniDir "C:/apps/PHP"
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidInitialEnv PHPRC "C:/apps/PHP"
FcgidInitialEnv PATH "C:/apps/PHP;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/TEMP"
FcgidInitialEnv TMP "C:/WINDOWS/TEMP"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 40
FcgidConnectTimeout 10
FcgidMaxProcesses 1000
FcgidOutputBufferSize 64
FcgidProcessLifeTime 120
FcgidMaxRequestsPerProcess 10000
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 1
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/apps/PHP/php-cgi.exe" .php
</Files>
# Do not comment out below line
</IfModule>
|
Give it a shot. |
|
Back to top |
|
|
|
|
|
|