LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-19-2009, 08:29 PM   #1
douglas.palmer
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Angry Warning: GDChart::out()


I loaded gdchart and the dependencies but I am still getting this error when I try to view any of the example scripts.

Warning: GDChart:ut() [gdchart.out]: Unable to open './line.png' for writing in /var/www/chart.php on line 12.

Here is the codewithout the line numbers of course)
1 <?php
2
3 $g = new GDChart(GDChart::LINE);
4 $g->addValues(array(2.5, 5.1, 8.6, 12.0, 15, 9, 8, 7));
5 $g->addValues(array(5.0, 8.0, 9.2, 10.2, 7, 8, 10, 9));
6 $g->addValues(array(8.0, 10.0, 14.0, 18.2, 16, 14, 12, 10));
7 $g->setLabels(array("Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug"));
8 $g->setColors(array(0x1133aa, 0xaa3311, 0x33aa11));
9 $g->requestedYmin = 0;
10 $g->ylabelDensity = 25;
11 $g->ylabelFmt = "%.0f";
12 $g->out(640,480,GDChart::PNG,"./line.png");
13
14 ?>

I have tried changing line 12 to: $g->out(640,480,GDChart::PNG); with no luck.

I am running Ubuntu 9.04 desktop, apache2, php5

Any help would be greatly appreciated.
 
Old 10-19-2009, 09:35 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Sounds like you don't have write permission in that directory.

I hasten to add - that's generally a Good Thing: you definitely don't WANT stuff running in the context of your web server writing whatever it wants, wherever it wants. That would be Bad :-)

So how do you get your chart?

Create a directory that your web server (typically user "www") has permission to read and write, then specify that directory.

For example:
Quote:
umask 0
chmod +rw /tmp
vi /var/www/chart.php
Quote:
...$g->out(640,480,GDChart::PNG,"/tmp/line.png");
Try it in "/tmp", and verify that it works.

Then decide on which directory your graphics should actually go, then modify:
a) your Linux filesystem permissions
b) your apache.conf aliases and permissions

'Hope that helps .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ld: warning drand Linux - Software 2 05-25-2010 04:03 AM
GC Warning ashlesha Linux - General 3 07-17-2006 03:58 PM
warning! Volcano Linux - Newbie 4 04-24-2006 07:08 AM
Hello/WARNING tn0615 LinuxQuestions.org Member Intro 1 01-09-2006 10:21 PM
what is this warning in C? h/w Programming 7 10-26-2003 11:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration