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 2 ## remember the length… Read More »

PHP and MySQLi SELECT query

Selec All Code:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <?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… 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

htaccess surpress / display PHP errors

Selec All Code:1 2 3 4 5 6 7 8 9 10 11 12 13 # supress php errors php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_value docref_root 0 php_value docref_ext 0   # display php errors php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on php_value docref_root 1 php_value docref_ext 1

Vertical text in an image

Selec All Code:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 <?php header ("Content-type: image/png");   // imagecreate (x width, y width)   $text = str_replace(’_’, ‘ ‘, $_GET[’text’]); $text = ucwords($text);   $img_handle =… Read More »

Category: PHP