Re: [PHP] PHP Warning: imagettftext()

2008-07-25 Thread Lou Baccari


Hello,

After reading Practical PHP Programing I came across a reference that 
said On Unix machines, you may find PHP searches in 
/usr/share/fonts/truetype.  Well I find that my php script executes 
successfully when I placing my arial.ttf file into 
/usr/share/fonts/truetype directory.


So I tried using  |putenv('GDFONTPATH=' . realpath('.')); and $font 
= dirname(__FILE__).'/arial.ttf'; and I can not over ride the 
GDFONTPATH from search in | /usr/share/fonts/truetype. 

Do I have other options that will allow me to point to the ttf file 
local to the php script?  Is this a bug ?


Thanks,

Lou


Lou Baccari wrote:



Hello,

 I'm trying to move a site over to the V5 of CentOS and I having 
problems with php/gd/freetype.  It looks like my older
systems which is running php-4.3.8-1.1, gd-2.0.15-1, freetype-2.1.4-5 
can execute the code successfully.


 Now when I try to execute the same code on CentOS V5 with php-5.2.6, 
php-gd-5.2.6, gd-2.0.33-9.4,

freetype-2.2.1-20 the same piece of code fails with the error:
 *[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 10
[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 11

***

 I read through php.net and marc.info but I have not yet found a 
solution,  Any ideas?


Thanks,

Lou

code 


?php
//header(Content-type: image/png);
$im = imagecreate(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'BBBleh...';
$font = 'arial.ttf';
putenv( 'GDFONTPATH='.realpath('.') );
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

header(Content-type: image/png);

imagepng($im);
imagedestroy($im);
?






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Warning: imagettftext()

2008-07-25 Thread Lou Baccari


Sorry for the additional mail but I found the variable GDFONTPATH should 
be GD_FONTPATH, the example below works for me now.


  putenv('GD_FONTPATH=' . realpath('.')); 





Lou Baccari wrote:


Hello,

After reading Practical PHP Programing I came across a reference that 
said On Unix machines, you may find PHP searches in 
/usr/share/fonts/truetype.  Well I find that my php script executes 
successfully when I placing my arial.ttf file into 
/usr/share/fonts/truetype directory.


So I tried using  |putenv('GDFONTPATH=' . realpath('.')); and $font 
= dirname(__FILE__).'/arial.ttf'; and I can not over ride the 
GDFONTPATH from search in | /usr/share/fonts/truetype.
Do I have other options that will allow me to point to the ttf file 
local to the php script?  Is this a bug ?


Thanks,

Lou


Lou Baccari wrote:



Hello,

 I'm trying to move a site over to the V5 of CentOS and I having 
problems with php/gd/freetype.  It looks like my older
systems which is running php-4.3.8-1.1, gd-2.0.15-1, 
freetype-2.1.4-5 can execute the code successfully.


 Now when I try to execute the same code on CentOS V5 with 
php-5.2.6, php-gd-5.2.6, gd-2.0.33-9.4,

freetype-2.2.1-20 the same piece of code fails with the error:
 *[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 10
[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 11

***

 I read through php.net and marc.info but I have not yet found a 
solution,  Any ideas?


Thanks,

Lou

code 


?php
//header(Content-type: image/png);
$im = imagecreate(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'BBBleh...';
$font = 'arial.ttf';
putenv( 'GDFONTPATH='.realpath('.') );
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

header(Content-type: image/png);

imagepng($im);
imagedestroy($im);
?








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Warning: imagettftext()

2008-07-25 Thread Lou Baccari


Thanks for the reply,  I felt a little lonely since no one responded 
earlier.  No one else that I've been in contact with have complained 
about date/time issues with my client and any emails.


Yes I sent my first email on Monday, 7/21/08, and then I sent the last 
two messages today.  The first one today looking for help and then the 
second one providing the solution. 


Lou.



Daniel Brown wrote:

On Mon, Jul 21, 2008 at 1:14 PM, Lou Baccari [EMAIL PROTECTED] wrote:
  

Hello,

 I'm trying to move a site over to the V5 of CentOS and I having problems
with php/gd/freetype.  It looks like my older
systems which is running php-4.3.8-1.1, gd-2.0.15-1, freetype-2.1.4-5 can
execute the code successfully.
  


Lou,

I'm glad you solved the problem, but for whatever reason (I'm not
sure about anyone else, just my own experience), all three messages
just came through this morning.  Did you actually send this first
message on Monday, or was there a date issue with your client or
server?

  


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Warning: imagettftext()

2008-07-21 Thread Lou Baccari



Hello,

 I'm trying to move a site over to the V5 of CentOS and I having 
problems with php/gd/freetype.  It looks like my older
systems which is running php-4.3.8-1.1, gd-2.0.15-1, freetype-2.1.4-5 
can execute the code successfully.


 Now when I try to execute the same code on CentOS V5 with php-5.2.6, 
php-gd-5.2.6, gd-2.0.33-9.4,
freetype-2.2.1-20 the same piece of code fails with the error: 

 *[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 10
[Mon Jul 21 13:13:11 2008] [error] [client 137.203.140.206] PHP 
Warning:  imagettftext() [a 
href='function.imagettftext'function.imagettftext/a]: Could not 
read font in /www/html/template/lou2.php on line 11

***

 I read through php.net and marc.info but I have not yet found a 
solution,  Any ideas?


Thanks,

Lou

code 


?php
//header(Content-type: image/png);
$im = imagecreate(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'BBBleh...';
$font = 'arial.ttf';
putenv( 'GDFONTPATH='.realpath('.') );
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

header(Content-type: image/png);

imagepng($im);
imagedestroy($im);
?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] error Failed opening for inclusion

2008-06-12 Thread Lou Baccari


Hello,

Sorry to brother you but I'm really in a pinch with this problem and I 
need to resolve it.


The older Fedora Apache server runs just fine with DocumentRoot 
pointing to the NFS share. The NFS share is on our OS X file server. The 
new CentOS runs fine when DocumentRoot is pointing to the local file 
systems.  When I move DocumentRoot to the NFS share I can not even run 
phpinfo(). 


[root@ ~]# more /projects/proj2/www/html/php_info.php
?
phpinfo();
?
root@ ~]# ls -als /projects/proj2/www/html/php_info.php
4 -rwxrwxrwx 1 root apache 19 Jun 10 16:58 
/projects/proj2/www/html/php_info.php




I've checked permissions, paths, etc... and can not find a cause to this 
problem.  I've compared php.ini and httpd.conf from both fedore and 
centos and they are the pretty much the same.  Both fodera and centos 
are on the same subnets. 



After further investigation I'm find that some php files, below the root 
directory, run successfully,  but now if I edit it or copy it to other 
name the new php file will not run anymore.  I end up with the errors 
listed below. 


I could use some help,  Thanks.

Lou


Lou Baccari wrote:


sorry if I double posted:


Hello,

I'm trying to move my apache server from a Fedora Core 1 with PHP V 
4.3.8 onto a newly built  Centos 5 with PHP 5.1.6, all applications 
installed by rpms.  The www root dir is /projects/proj2/www/html and 
it is a nfs mounted share.


During the installation I had moved all of the contents from the 
remote mount /projects/proj2/www/html to a local disk on the CentOS, 
I tested and I believed I had resolved all issues on the new server.
Now when I changed my httpd.conf to point to the nfs share 
/projects/proj2/www/html my php scripts fail,  even  phpinfo();  
fails.  All errors are identical to the following except for the php 
file name.



*Warning*: Unknown: failed to open stream: Value too large for defined 
data type in *Unknown* on line *0*


*Warning*: Unknown: Failed opening 
'/projects/proj2/www/html/php_info.php' for inclusion 
(include_path='.:/usr/share/pear') in *Unknown* on line *0

* 

Again when I run these same scripts from the local disk I do not 
received any errors.  Any ideas to correcting this problem?


Thanks,

Lou.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] error Failed opening for inclusion

2008-06-11 Thread Lou Baccari


sorry if I double posted:


Hello,

I'm trying to move my apache server from a Fedora Core 1 with PHP V 
4.3.8 onto a newly built  Centos 5 with PHP 5.1.6, all applications 
installed by rpms.  The www root dir is /projects/proj2/www/html and 
it is a nfs mounted share.


During the installation I had moved all of the contents from the remote 
mount /projects/proj2/www/html to a local disk on the CentOS, I tested 
and I believed I had resolved all issues on the new server.
Now when I changed my httpd.conf to point to the nfs share 
/projects/proj2/www/html my php scripts fail,  even  phpinfo();  
fails.  All errors are identical to the following except for the php 
file name.



*Warning*: Unknown: failed to open stream: Value too large for defined 
data type in *Unknown* on line *0*


*Warning*: Unknown: Failed opening 
'/projects/proj2/www/html/php_info.php' for inclusion 
(include_path='.:/usr/share/pear') in *Unknown* on line *0

* 

Again when I run these same scripts from the local disk I do not 
received any errors.  Any ideas to correcting this problem?


Thanks,

Lou.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php