Page 1 of 2

How do i enable SNMP with XAMPP Linux

PostPosted: 24. December 2004 21:23
by cityguru
I have run the installation for Linux however i now need to activate SNMP for PHP, i have already downloaded the snmp rpms and installed them but i am guessing i need to compile then for PHP, however i do not know how to do this after PHP has already been installed. I know on windows it would be as easy as uncommenting the extension however this is Linux and i am totally lost on this so any help anyone can offer it would be most appreciated and if the instructions can be as detailed as possible that would be even better but anything is appreciated

Thanks in advance

PostPosted: 24. December 2004 22:16
by Oswald
Dear citiyguru!

Bad news: XAMPP for Linux doesn't support SNMP. If you need SNMP support in PHP you need to go the long way and use the PHP coming with your distribution. Or if the distribution PHP also doesn't support SNMP you need to go the very long way and compile PHP completely by yourself.

Best regards

PostPosted: 29. December 2004 06:49
by cityguru
Well it looks like i will have to re-compile PHP however to do this i would need to know where i can execute the ./configure command that one would normally need to run when compiling PHP, any idea where this command would exist?

PostPosted: 29. December 2004 08:53
by Kristian Marcroft

you will have to download the php Source from
The configure options we use can be found in a phpinfo()

So long

PostPosted: 29. December 2004 12:32
by cityguru
thanks for the info, but PHP is all over the place in Xampp, the file structure doesnt look the same as the php source that i download, so where do i put the source folders (which ones where?)?

Thanks for the help

PostPosted: 29. December 2004 12:38
by Kristian Marcroft

what you do...
download the php source to /usr/local/src
untar the source.
change to the unpacked dir.

Use the following ./configure:
Code: Select all
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc \
--with-mysql=/opt/lampp --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-dbase \
--enable-discard-path --enable-exif --enable-filepro --enable-force-cgi-redirect --enable-ftp \
--enable-gd-imgstrttf --enable-gd-native-ttf --with-ttf --enable-magic-quotes --enable-memory-limit \
--enable-safe-mode --enable-shmop --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-track-vars \
--enable-trans-sid --enable-versioning --enable-wddx --enable-yp --with-ftp --with-gdbm=/opt/lampp \
--with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp --with-tiff-dir=/opt/lampp --with-freetype-dir=/opt/lampp
--without-xpm --with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp --with-expat-dir=/opt/lampp
--enable-xslt --with-xslt-sablot=/opt/lampp -with-ming=/opt/lampp --with-dom=/opt/lampp --with-ldap=/opt/lampp
--with-ncurses=/opt/lampp --with-gd --with-imap-dir=/opt/lampp --with-imap-ssl --with-imap=/opt/lampp \
--with-gettext=/opt/lampp --with-mysql-sock=/opt/lampp/var/mysql/mysql.sock --with-mcrypt=/opt/lampp \
--with-mhash=/opt/lampp --enable-sockets --enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex \
--enable-zend-multibyte --with-zip=/opt/lampp --enable-exif --with-bz2=/opt/lampp \

After this has successfully finished, you do a
and then a make install
Then the finished compiled php with snmp SUpport is installed to /opt/lampp where it belongs.

Good Luck
So long

PostPosted: 29. December 2004 12:56
by cityguru
awesome thank you so much, just one quick question should i take what you put above into a file and run it as a script or copy and paste it straight into the terminal window?

Thanks again

PostPosted: 29. December 2004 13:03
by Kristian Marcroft

you can do it as you wish..
I usually create a File like
and paste the above into the file.
Save, make executable and then execute.
I put the configure in a file, because it makes it easier to edit and I can reuse it when needed.

So long

PostPosted: 29. December 2004 16:44
by cityguru
sorry one other question, the extensions refrence "=/opt/lampp" however isnt that incorrect since i see nothing directly under that folder for these extensions such as an associate ldap extension or anything, so wouldnt the above give me an error? or do i need to change =/opt/lampp with a different path such as one pointing to /usr/local/src/php-4.3.9/lib or something like that

PostPosted: 29. December 2004 22:32
by Kristian Marcroft

the above is absolutly correct.
I have compiled PHP hundreds of times with the above options.
These options are also shown in phpinfo().. check if you don't believe me.

So long

PostPosted: 30. December 2004 12:22
by c815902
Hi, Kristian

I got same problem here. :roll:

Code: Select all

[root@localhost php-4.3.10]# ./
creating cache ./config.cache
checking host system type... config.sub: missing argument
Try `config.sub --help' for more information.

checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... exit 0;
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for mawk... no
checking for gawk... gawk
checking for bison... bison -y
checking bison version... 1.875 (ok)
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for working const... yes
checking flex version... 2.5.4 (ok)
checking for pthreads_cflags... -pthread
checking for pthreads_lib...

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking for member fd in BUFF *... no
checking for mod_charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /opt/lampp/bin/apxs follows:
cannot open /opt/lampp/build/ No such file or directory at /opt/lampp/bin/apxs line 217.
configure: error: Aborting
./ line 2: --with-mysql=/opt/lampp: No such file or directory
./ line 3: --enable-discard-path: command not found
./ line 4: --enable-gd-imgstrttf: command not found
./ line 5: --enable-safe-mode: command not found
./ line 6: --enable-trans-sid: command not found
./ line 7: --with-jpeg-dir=/opt/lampp: No such file or directory
./ line 8: --without-xpm: command not found
./ line 9: --enable-xslt: command not found
./ line 10: --with-ncurses=/opt/lampp: No such file or directory
./ line 11: --with-gettext=/opt/lampp: No such file or directory
./ line 12: --with-mhash=/opt/lampp: No such file or directory
./ line 13: --enable-zend-multibyte: command not found
./ line 14: --with-snmp: command not found

[root@localhost php-4.3.10]#

PostPosted: 30. December 2004 13:30
by Kristian Marcroft

1. do you have the dev Package installed?
2. your is faulty. Please write the hole ./configure <options> in one line, or break the Lines with a \ at the end.
Do not create this File with Openoffice or simular.
Use either vim/mc/joe/nano etc.

So long

PostPosted: 30. December 2004 17:28
by cityguru
you mentioned the development package, is that the development package for XAMPP? and if so i assume you mean to download that in conjunction with the PHP source from

As for the development package i wasnt sure where to place it since when extracted it came up under a folder called "lampp", so i assumed to put its sub folder contetns under /opt/lampp.

However i did mak sure to e careful not to overwrite anything since i know if a folder already exists and you move a folder with the same name you will completely delete the older one, so a sub folder did match names (ie: "lib") i then opened both the production lib folder and the development lib folder and then moved over any non existing files/folders.

Was this correct? Tonight i am going to try all the above as well

Thanks again

PostPosted: 30. December 2004 17:37
by Kristian Marcroft

with the dev. Package I mean the one from our Downlod Page.
And you just have to compy it over the existing /opt/lampp

You will not overwrite anything...
The dev Package has just got a couple of Files that are needed to add more Software to XAMPP or redevelop XAMPP. (headerfiles includes etc.)

So long

PostPosted: 30. December 2004 18:50
by cityguru
looks like it ran ok however i got the following after it was done:
./ line 8: --without-xpm: command not found
./ line 9: --enable-xslt: command not found
./ line 10: --with-ncurses=/opt/lampp: No such file or directory

Should i be concerned with the above?