LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2013, 01:06 AM   #1
rose8383
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Rep: Reputation: Disabled
what does this error message mean?


Hi,

I tried to write qr code url into this directory /var/www/html/O/QR_Code/image.png AND database on field 'imagePNG' using this codes:
PHP Code:
<?php
//if ($_POST['submit']) { 
if ($_SESSION['MM_Username']) {


    
//$msg = $_REQUEST['msg'];
$msg$row_RSU['QR_CODES'];
    
$url  'http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl='.$msg;
 
    
// initialize cURL settings
    
$ch curl_init ($url);
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_BINARYTRANSFER,1);
    
curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
 
    
// fetch raw data
    
$rawdata curl_exec($ch);
    
curl_close($ch);
     
    
// convert it to a GD image and save
    
$img imagecreatefromstring($rawdata);

    
// now save a copy of the new image to the cache directory
    
imagePNG($img'/var/www/html/O/QR_Code/image.png'); 
    
    print 
'<center><img src="http://inforlix.com/O/QR_Code/image.png"><br>';
    
    
//print('<font color=#30afd8><H2>Saved QR Code.</H2></font>');

    
imagedestroy($img);
}   
?>

But I got this error message instead:
Code:
Warning: imagepng() [function.imagepng]: Unable to access /var/www/html/O/QR_Code/image.png in /home/inforlix/public_html/O/updated5.php on line 1074
Question:
1) What does the error message mean? Do I need permission to make the /var/www writable

2) OR do i need to change the document root? If so, how can I do this on cpanel or via SSH?

Please guide.
 
Old 11-04-2013, 04:42 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,267

Rep: Reputation: 298Reputation: 298Reputation: 298
Hi

/var/www/html/O/QR_Code needs to be writable. You shouldn't need to change document root. Also, are the QR codes static? You seem to use the same filename, even if the QR codes seem to change. It can be problems if two different visitors request a QR code at the same time.
 
Old 11-04-2013, 04:49 AM   #3
rose8383
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Guttorm View Post
Hi

/var/www/html/O/QR_Code needs to be writable. You shouldn't need to change document root. Also, are the QR codes static? You seem to use the same filename, even if the QR codes seem to change. It can be problems if two different visitors request a QR code at the same time.
Hi Guttorm,

I was doing this code for one user only that is admin. This admin will have 'hello' qrcode image which will be saved as image.png on the directory.

I've changed the directory:
PHP Code:
 imagePNG($img'/home/inforlix/public_html/O/QR_Code/image.png');  
     
 print 
'<center><img src="http://inforlix.com/O/QR_Code/image.png"><br>'

I think this should be fine right? Also, the QR image is not necessary to be inserted into database is it? Because I run this code and it did nothing to image field(NULL value) but it did display the hello QR code as I plan.
 
  


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
Got this error message from process, what does this message mean? Vita Linux - Newbie 3 07-20-2013 09:53 AM
Error 502 : Display Fatal Error Message, Error pushing image, dbpaCT failed! HaloCheng Linux - Newbie 1 09-12-2012 01:02 PM
Strange Repeating Error message in /var/log/message lucktsm Linux - Security 2 10-27-2006 09:29 AM
Error message received from system Error while reading filter description for true Steel_J Linux - Software 2 03-04-2006 07:10 PM
QMAIL error:554 Transaction failed: message format error mpk25 Linux - Software 1 10-15-2004 01:53 PM


All times are GMT -5. The time now is 07:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration