Category Archives: PHP

FreeBSD, Fatal error: Call to undefined function geoip_country_name_by_name()

Getting Fatal error: Call to undefined function geoip_country_name_by_name() ? Install /usr/ports/net/pecl-geoip # cd /usr/ports/net/pecl-geoip && make install clean # “/usr/local/www/awstats/cgi-bin/awstats.pl” -update -config=account.ptiexpress.com -configdir=”/usr/local/etc/awstats/” Error: Plugin load for plugin ‘geoipfree’ failed with return code: Error: Can’t locate Geo/IPfree.pm in @INC (you may need to install the Geo::IPfree module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.18 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.18/mach /usr/local/lib/perl5/5.18 /usr/local/lib/perl5/site_perl/5.18 /usr/local/lib/perl5/site_perl/5.18/mach… Read More »

FreeBSD and phpList : White Screen of Death

Despite turning on errors in php.ini I wasn’t getting any error messages when I went to http://ipaddress/lists/ or http://ipaddress/lists/admin/, I just received a white screen of death. After adding error_log() statements thoughout the code to trackdown the issues I discovered that execution was getting as far as line 198 in /lists/admin/init.php Selec All Code:1   copying this to a… Read More »

PHP and MySQLi SELECT query

<?php $i = new mysqli(‘localhost’, ‘username’, ‘password’, ‘database’); if ($result = $i->query(“SELECT * FROM tablename;”) ) { printf(“Select returned %d rows.\n”, $result->num_rows); if ($result->num_rows > 0) { while ($row = $result->fetch_object()) { print_r($row); } } $result->close(); } else { printf(“%d : %s\n”, $i->errno, $i->error); } ?> if (!$i->query(“INSERT INTO table VALUES(null, ‘x’,’x’,’x’);” ) ) {… Read More »

Category: PHP

Creating PDFs from PHP

http://www.fpdf.org/ (Used on PTI and JMS) http://www.ros.co.nz/pdf/ Never used, but looks interesting.

Category: PHP