QmailScanner Statistics added step for PHP

Started by David Pierron, February 20, 2004, 09:59:35 AM

Previous topic - Next topic

David Pierron

I'm all about the eye candy ... I followed the steps for the QmailScanner Statistics from the FAQ, and everything worked great ... The end result didn't work though since I am assuming PHP doesn't have GD support compiled into it ...

Almost every time I try to compile a piece of software because I need some added feature, I break it in one way or another ... Is there an easy way to simply re-compile/re-install PHP with the GD support so that it can create the images on the fly?

I would attempt this, but I don't want to break my toaster just cause I want to see some pretty images ...  I would get the GD part working, but then I would probably be missing something else that I should have stuck in there as well ...
David Pierron
http://www.icuhost.net" target="_blank">http://www.icuhost.net

matt

Actually, your PHP is probably fine. Go visit the QSS forum on Sourceforge and you'll see a few code changes you need to make, or you need to turn on register_globals.  Either way fixes it so you get your pretty graphs.

David Pierron

Of course I tried the .htaccess file and the code changes before I referred to the docs that say PHP must have GD and PNG support ...  Mine doesn't so it need to be recompiled ...  Easy way to do this?  Damn Windows has me used to uncommenting the DLL that I need ...
David Pierron
http://www.icuhost.net" target="_blank">http://www.icuhost.net

David Pierron

Would this be correct?

1.) Update ports
2.) cd /usr/ports/www/mod_php4
3.) make deinstall
4.) make reinstall

.. and I should be prompted what to compile PHP4 with?
David Pierron
http://www.icuhost.net" target="_blank">http://www.icuhost.net

netgeek

Yes you can do that or you can edit your php.ini file in /usr/local/etc and add modules that way.
FYI: If you edit or change your php installation you must restart the web server for changes to take effect.

The gdlib should be in /usr/local/lib/
check to see if it is there, if so just edit the ini to include it instead of reinstalling php.
latest versions are:
libglib12.a
libglib12.so
libglib12.so.3

David Pierron

matt

you need to turn on register_globals

I believe this is going away someday, and it's also highly recommended that you NOT have register_globals On ...  I am confused to have you give this advice?

As for adding the modules to the php.ini, I didn't have any sort of GD installed, so I did the deinstall/reinstall and that brought the graphs, I also fixed a typo in one of the changes I made to the source file ...

Thanks for the help ...

To make things concise, here are the changes to be made after Matt's FAQ: (My register_globals is Off with no .htaccess file suggested by SF Forums)

For anyone wanting to use version 2.02 with register_globals = Off, just change the following files.

Edit getGraph.php
line 63 gets changed to:
$data = explode(",",rawurldecode($_GET[data]));

line 65 needs to be:
$t = explode(",",rawurldecode($_GET[t]));
so that it displays the virus names.

Edit getGraph1.php
line 32 gets changed to:
$points = explode(",",$_GET[data]);
change line 36 from:
$config = array("startHGrad" => $s,...<snip>
to:
$config = array("startHGrad" => $_GET,...<snip>

Changes posted by SourceForge user: cwispy (Shane Chrisp)
David Pierron
http://www.icuhost.net" target="_blank">http://www.icuhost.net

matt

Quote:

I believe this is going away someday, and it's also highly recommended that you NOT have register_globals On ... I am confused to have you give this advice?


You quoted me out of context.  Naughty.

To assume I was advising that you should run your PHP with register_globals ON would be an error. I was merely noting that QSS expects that and pointed readers to WHERE to go should they have futher questions.

I personally don't like PHP, and for many of the same reasons I detest Microsoft versions of programming languages. I've used them, extensively, and using them sure is easy up front but owning them solutions over the long haul sure is a pain in the south end of a northbound horse. I recently did an entire rewrite on a very large PHP project and ported the entire project to Perl so that I wouldn't keep having to make code changes every time I updated mod_php.