couple of qs (mod_rewrite and a php quicky)

Soldato
Joined
6 Feb 2004
Posts
20,859
Location
England
i've just installed ubuntu for something to do but i'm having a few problems getting my webserver up and running. apache/php5 and the gd library have all installed just fine, phpinfo shows gd to be enabled - it all looks good.....

but my first problem is with GD and true type fonts. i just can't get it to work. i've got the font in the same directory as the script so i would have thought nothing can go wrong. but it aint working..... :(

Code:
$fontsize = 10;
$font = 'arialuni.ttf';
Imagettftext($im, $fontsize, 0, 3, 10, $tc, $font, $title);

just gives

Code:
Warning: imagettftext() [function.imagettftext]: Could not find/open font in

next is mod_rewrite. i used to use abyss webserver on windows and i believe that uses regular expressions. this is my working code from abyss.....

/lastfm/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/(.+)/sig.png
/lastfm/main.php?userid=$1&type=$2&font=$3&width=$4&row=$5&tc=$6&bg=$7

is that first line proper regexp that mod_rewrite can use or not? i'm completely clueless.... :(
 
bah. var dump returns true? why wouldn't it? :confused:

and mod_rewrite, spent an hour faffing about and have got nowhere. **** linux and apache... :D tried a simple rule from page1 > page2 and i couldn't even get that to work. enabled rewrite debugging and it created a log in the right place. except it's empty.... :(
 
meh. it worked straight away when i put it in a .htaccess file but i was trying to avoid that by puttting it in the main server config file (apache2.conf). even putting "RewriteEngine on" in the conf and the rule in .htaccess didn't work either so i don't know what's going on there.... :o

and the font just needed a "./" before it. :p
 
Last edited:
Back
Top Bottom